visiblevc / wordpress-starter

A slightly less shitty wordpress development workflow
688 stars 167 forks source link

Usability and readability - when errors happen with plugin install #110

Closed carpnick closed 6 years ago

carpnick commented 7 years ago

Overview

This issue is in regards to the output of docker-compose up when executing. No OS version or docker version specific issues

The earlier output, earlier version of the container/run.sh, when installing plugins showed which plugin was having issues installing/activating, see sample:

wp_ebscoind.ebsco.com | ==> Checking themes
wp_ebscoind.ebsco.com |   -> (1/2) 'ebsco' listed as a local volume. SKIPPING... 
wp_ebscoind.ebsco.com |   -> (2/2) 'ebsco-child' listed as a local volume. SKIPPING... 
wp_ebscoind.ebsco.com | ==> Checking for orphaned themes
wp_ebscoind.ebsco.com |   -> 'twentyfifteen' no longer needed. Pruning ✓
wp_ebscoind.ebsco.com |   -> 'twentyseventeen' no longer needed. Pruning ✓
wp_ebscoind.ebsco.com |   -> 'twentysixteen' no longer needed. Pruning ✓
wp_ebscoind.ebsco.com | ==> Checking plugins
wp_ebscoind.ebsco.com |   -> (1/13) 'ajax-load-more' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (2/13) 'akismet' found. SKIPPING... 
wp_ebscoind.ebsco.com |   -> (3/13) 'all-in-one-wp-security-and-firewall' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (4/13) 'better-search-replace' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (5/13) 'gravityforms' listed as a local volume. Activating... 
wp_ebscoind.ebsco.com |   -> (6/13) 'hyperdb' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (7/13) 'instagram-feed' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (8/13) 'mailgun' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (9/13) 'share-this' not found. Installing... Error: No plugins installed.
wp_ebscoind.ebsco.com | ✘
wp_ebscoind.ebsco.com |   -> (10/13) 'types' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (11/13) 'wordpress-importer' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (12/13) 'wordpress-seo' not found. Installing... ✓
wp_ebscoind.ebsco.com |   -> (13/13) 'worker' not found. Installing... ✓
wp_ebscoind.ebsco.com | ==> Checking for orphaned plugins
wp_ebscoind.ebsco.com |   -> 'hello' no longer needed. Pruning... ✓
wp_ebscoind.ebsco.com |   -> '0-worker' no longer needed. Pruning... ✓
wp_ebscoind.ebsco.com | ==> Finalizing

Latest version however, makes it very hard for developer to determine what went wrong:

wp_ebscoind.ebsco.com | ==> Checking database
wp_ebscoind.ebsco.com | Success: Database created.
wp_ebscoind.ebsco.com | Success: Imported from '/data/mysql.sql'.
wp_ebscoind.ebsco.com | Success: Made 207 replacements.
wp_ebscoind.ebsco.com | ==> Checking themes
wp_ebscoind.ebsco.com | Deleted 'twentyfifteen' theme.
wp_ebscoind.ebsco.com | Deleted 'twentyseventeen' theme.
wp_ebscoind.ebsco.com | Deleted 'twentysixteen' theme.
wp_ebscoind.ebsco.com | Success: Deleted 3 of 3 themes.
wp_ebscoind.ebsco.com | ==> Checking plugins
wp_ebscoind.ebsco.com | Warning: The package could not be installed. "No valid plugins were found."
wp_ebscoind.ebsco.com | Warning: Couldn't find 'share-this' in the WordPress.org plugin directory.
wp_ebscoind.ebsco.com | Error: Only installed 9 of 11 plugins.
wp_ebscoind.ebsco.com | Plugin installed successfully.
wp_ebscoind.ebsco.com | Deleted 'hello' plugin.
wp_ebscoind.ebsco.com | Success: Deleted 1 of 1 plugins.
wp_ebscoind.ebsco.com | Plugin 'akismet' activated.
wp_ebscoind.ebsco.com | Plugin 'mailgun' activated.
wp_ebscoind.ebsco.com | Plugin 'worker' activated.
wp_ebscoind.ebsco.com | Success: Activated 3 of 11 plugins.
wp_ebscoind.ebsco.com | ==> Finalizing

As you can see in the first output, I could immediately tell which plugin was having problems, with the second not so much.

We almost need a verbose logging component, or just add more logging. It is very hard to tell, as a developer what went wrong purely based on the output. The developer currently has to login to the WPAdmin and validate and find out which plugins were activated, and which ones were not.

docker-compose.yml

version: '2'
services:
  wordpress:
    container_name: wp_ebscoind.ebsco.com
    image: visiblevc/wordpress:latest-php5.6  #Currently using PHP 5.6 in WPEngine
    ports:
      - 8080:80
      - 443:443
    volumes:
      - ./data:/data                                                                    #For importing the database.
      - ./app/wp-content/uploads:/app/wp-content/uploads                                #Dont want these in source control
      - ./app/wp-content/themes/ebsco:/app/wp-content/themes/ebsco                    #Themes that are private
      - ./app/wp-content/themes/ebsco-child:/app/wp-content/themes/ebsco-child        #Themes that are private
      - ./app/wp-content/plugins/gravityforms:/app/wp-content/plugins/gravityforms        #plugin that are private
    environment:
      DB_NAME: wordpress
      DB_PASS: root
      DB_PREFIX: ei_
      PLUGINS: >-
        ajax-load-more,
        akismet,
        all-in-one-wp-security-and-firewall,
        better-search-replace,
        [local]gravityforms,
        hyperdb,
        instagram-feed,
        mailgun,
        share-this,
        types,
        wordpress-importer,
        wordpress-seo,
        worker
      THEMES: >-
        [local]ebsco,
        [local]ebsco-child
      SEARCH_REPLACE: https://ebscoind.staging.wpengine.com,http://localhost:8080
      WP_DEBUG: 'true'  #Turn on debug mode...?
      VERBOSE: 'true'
  db:
    container_name: mysql_ebscoind.ebsco.com
    restart: always
    image: mysql:5.6      #Using mysql currently in WPEngine
    ports:
      - 13306:3306
    volumes:
      - data:/var/lib/mysql2
    environment:
      MYSQL_ROOT_PASSWORD: root
volumes:
  data: {}

Project structure

/data
  /database.sql
/app
  /wp-content
    /plugins
      /my-plugin
    /themes
      /my-theme
dsifford commented 7 years ago

In a recent update, we opted to use the built-in logging provided by wp-cli, rather than to use our own logging strategy due to the unnecessary complexity that came with logging things our own way.

I agree with your thoughts, however, I think this issue might be better served if it's brought up in the wp-cli repo directly rather than here as it will benefit both the users of this docker orchestration as well as users of the wp-cli tool.

Does that sound reasonable?

carpnick commented 7 years ago

Good call @dsifford . See PR using wp-cli output natively now.

carpnick commented 6 years ago

Closing with merged PR