78% motivation-for-woocommerce

Code Review | Motivation for WooCommerce

WordPress plugin Motivation for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: motivation-for-wo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2019
  • Latest release: Jul 9, 2019
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: ivanchernyakov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.13MB] [CPU: ▼10.57ms] Passed 4 tests

This is a short check of server-side resources used by Motivation for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.97 ▼0.5017.69 ▼26.48
Dashboard /wp-admin3.31 ▼0.0449.94 ▼13.30
Posts /wp-admin/edit.php3.36 ▲0.0051.21 ▲1.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.80 ▲3.07
Media Library /wp-admin/upload.php3.23 ▲0.0034.06 ▼4.35
Add New /wp-admin/post-new.php?post_type=motivation3.0426.54
Motivations /wp-admin/edit.php?post_type=motivation3.0430.53

Server storage [IO: ▲0.04MB] [DB: ▲0.57MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Motivation for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.18 ▼0.387.44 ▲5.6543.23 ▲1.52
Dashboard /wp-admin2,192 ▲185.55 ▼0.0287.32 ▼12.1438.44 ▼5.39
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0439.39 ▲3.8437.10 ▲0.95
Add New Post /wp-admin/post-new.php1,528 ▼023.27 ▲0.29678.58 ▼4.6562.11 ▼1.15
Media Library /wp-admin/upload.php1,397 ▼34.25 ▲0.03111.89 ▲6.1549.43 ▲4.86
Add New /wp-admin/post-new.php?post_type=motivation280.420.074.45
Motivations /wp-admin/edit.php?post_type=motivation280.420.083.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/motivation-for-woocommerce/admin/woo-class-motivation-post-type.php:48

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=motivation
    • > Network (severe)
    wp-admin/post-new.php?post_type=motivation - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=motivation
    • > Network (severe)
    wp-admin/edit.php?post_type=motivation - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

motivation-for-woocommerce/woo-motivation.php 85% from 13 tests

The entry point to "Motivation for WooCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
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 ("motivation-for-woocommerce.php" instead of "woo-motivation.php")
  • Text Domain: The text domain must be the same as the plugin slug, although 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 plugin959 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP464149763
CSS2715152
JavaScript141944

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity40.33
▷ Minimum class complexity9.00
▷ Maximum class complexity66.00
Average method complexity6.13
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods14.35%
▷ Public methods2295.65%
▷ Protected methods00.00%
▷ Private methods14.35%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin