77% plusminus-button

Code Review | PlusMinus Button

WordPress plugin PlusMinus Button scored77%from 54 tests.

About plugin

  • Plugin page: plusminus-button
  • Plugin version: 0.0.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.1+
  • WordPress version: 6.3.1
  • First release: May 28, 2019
  • Latest release: Jul 12, 2019
  • Number of updates: 5
  • Update frequency: every 11.4 days
  • Top authors: gipfel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /558 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.20MB] [CPU: ▼16.07ms] Passed 4 tests

This is a short check of server-side resources used by PlusMinus Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0551.16 ▲10.52
Dashboard /wp-admin3.09 ▼0.2129.07 ▼19.72
Posts /wp-admin/edit.php3.23 ▼0.1234.54 ▼16.30
Add New Post /wp-admin/post-new.php5.47 ▼0.4275.85 ▼22.79
Media Library /wp-admin/upload.php3.18 ▼0.0528.62 ▼5.46
PlusMinus Button /wp-admin/options-general.php?page=iv_spinner_options3.0827.82

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for PlusMinus Button
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,972 ▲23714.03 ▼0.559.84 ▲8.0542.05 ▼2.87
Dashboard /wp-admin2,212 ▲215.12 ▲0.21100.24 ▲0.8139.23 ▼5.97
Posts /wp-admin/edit.php2,098 ▲92.40 ▲0.3637.39 ▼5.1834.63 ▼0.26
Add New Post /wp-admin/post-new.php1,519 ▼1417.73 ▼5.47656.45 ▲2.9952.94 ▼5.81
Media Library /wp-admin/upload.php1,391 ▲64.25 ▲0.0599.29 ▼2.5843.63 ▼1.17
PlusMinus Button /wp-admin/options-general.php?page=iv_spinner_options8281.8128.3927.88

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=iv_spinner_options
    • > Warning in wp-content/plugins/plusminus-button/engine/ui/IvpmbAdminCore.php+8
    fopen(http://wp.com/wp-content/plugins/plusminus-button/engine/ui/js/jquery.fontselect.js): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

    • > GET request to /wp-admin/options-general.php?page=iv_spinner_options
    • > Warning in wp-content/plugins/plusminus-button/engine/ui/IvpmbAdminCore.php+13
    fopen(http://wp.com/wp-content/plugins/plusminus-button/engine/ui/css/fontselect-alternate.css): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

    • > GET request to /wp-admin/options-general.php?page=iv_spinner_options
    • > Warning in wp-content/plugins/plusminus-button/engine/ui/IvpmbAdminCore.php+17
    fopen(http://wp.com/wp-content/plugins/plusminus-button/engine/ui/js/spectrum.js): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

    • > GET request to /wp-admin/options-general.php?page=iv_spinner_options
    • > Warning in wp-content/plugins/plusminus-button/engine/ui/IvpmbAdminCore.php+21
    fopen(http://wp.com/wp-content/plugins/plusminus-button/engine/ui/css/spectrum.css): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(./engine/appearancesection/IvpmbAppearanceSettingsField.php): failed to open stream: No such file or directory in wp-content/plugins/plusminus-button/engine/appearancesection/IvpmbAppearanceSection.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/plusminus-button/engine/IvpmbAdmin.php:37
    • > PHP Warning
      require_once(./engine/appearancesection/IvpmbAppearanceSection.php): failed to open stream: No such file or directory in wp-content/plugins/plusminus-button/engine/IvpmbAdmin.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required './engine/appearancesection/IvpmbCheckbox.php' (include_path='.:/usr/share/php') in wp-content/plugins/plusminus-button/engine/appearancesection/IvpmbAppearanceSettingsField.php on line 8
    • > PHP Warning
      require_once(./engine/ui/IvpmbAdminCore.php): failed to open stream: No such file or directory in wp-content/plugins/plusminus-button/engine/IvpmbPlugin.php on line 8
    • > PHP Warning
      Use of undefined constant IVPMB_SPINNER_IMPROVED - assumed 'IVPMB_SPINNER_IMPROVED' (this will throw an Error in a future version of PHP) in wp-content/plugins/plusminus-button/engine/appearancesection/IvpmbAppearanceSettingsField.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required './engine/ui/IvpmbAdminCore.php' (include_path='.:/usr/share/php') in wp-content/plugins/plusminus-button/engine/IvpmbPlugin.php on line 8
    • > PHP Warning
      Use of undefined constant IVPMB_SPINNER_IMPROVED - assumed 'IVPMB_SPINNER_IMPROVED' (this will throw an Error in a future version of PHP) in wp-content/plugins/plusminus-button/engine/IvpmbPlugin.php on line 8
    • > PHP Warning
      require_once(./engine/appearancesection/IvpmbImage.php): failed to open stream: No such file or directory in wp-content/plugins/plusminus-button/engine/appearancesection/IvpmbCheckbox.php on line 8
    • > PHP Warning
      Use of undefined constant IVPMB_SPINNER_IMPROVED - assumed 'IVPMB_SPINNER_IMPROVED' (this will throw an Error in a future version of PHP) in wp-content/plugins/plusminus-button/engine/appearancesection/IvpmbCheckbox.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Contributors: No tags were detected
  • Contributors: Contributors not specified
The official readme.txt is a good inspiration

plusminus-button/plus-minus-button.php 85% from 13 tests

"PlusMinus Button" version 0.0.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("plusminus-button.php" instead of "plus-minus-button.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 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,863 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS349481,182
PHP127769419
JavaScript2205160
PO File24126102

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.36
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods54
▷ Static methods712.96%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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