84% woo-mainstem

Code Review | Woo MainStem

WordPress plugin Woo MainStem scored84%from 54 tests.

About plugin

  • Plugin page: woo-mainstem
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Jan 8, 2020
  • Latest release: Mar 22, 2021
  • Number of updates: 6
  • Update frequency: every 73.0 days
  • Top authors: mainstem (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /433 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼0.21ms] Passed 4 tests

A check of server-side resources used by Woo MainStem
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.11 ▼3.08
Dashboard /wp-admin3.37 ▲0.0749.95 ▲0.71
Posts /wp-admin/edit.php3.49 ▲0.1344.51 ▼1.86
Add New Post /wp-admin/post-new.php5.96 ▲0.07117.88 ▲14.53
Media Library /wp-admin/upload.php3.30 ▲0.0639.02 ▲3.38
MainStem Plugin /wp-admin/options-general.php?page=mainstem-plugin-settings3.2431.52

Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo MainStem
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.24 ▼0.951.82 ▼0.1146.94 ▼2.92
Dashboard /wp-admin2,210 ▲314.88 ▼0.96129.41 ▲20.0648.37 ▼0.03
Posts /wp-admin/edit.php2,093 ▲12.03 ▼0.0338.87 ▼1.9031.81 ▼4.83
Add New Post /wp-admin/post-new.php1,545 ▲822.73 ▼0.58645.77 ▼12.1873.73 ▲7.96
Media Library /wp-admin/upload.php1,395 ▲74.22 ▼0.00103.69 ▼4.3147.66 ▲2.95
MainStem Plugin /wp-admin/options-general.php?page=mainstem-plugin-settings6781.147.8324.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=mainstem-plugin-settings
    • > Error in wp-content/plugins/woo-mainstem/includes/admin.php+48
    Uncaught Error: Call to undefined function wc_get_orders() in wp-content/plugins/woo-mainstem/includes/admin.php:48
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): mainstem_plugin_options()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #5 {main}
    thrown
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mainstem-plugin-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mainstem-plugin-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mainstem-plugin-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+206
    Trying to get property 'ID' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mainstem-plugin-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: woocommerce, mainstem

woo-mainstem/mainstem.php 85% from 13 tests

The principal PHP file in "Woo MainStem" v. 1.1.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-mainstem.php" instead of "mainstem.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin435 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP366147384
PO File1141651

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods571.43%
▷ Protected methods00.00%
▷ Private methods228.57%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
MainStemLogo.png7.10KB3.67KB▼ 48.34%