62% show-my-sales

Code Review | Show My Sales

WordPress plugin Show My Sales scored62%from 54 tests.

About plugin

  • Plugin page: show-my-sales
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Dec 6, 2013
  • Latest release: Sep 13, 2014
  • Number of updates: 7
  • Update frequency: every 40.1 days
  • Top authors: mindstien (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,826 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.10MB] [CPU: ▼45.31ms] Passed 4 tests

A check of server-side resources used by Show My Sales
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▼0.5915.30 ▼36.73
Dashboard /wp-admin2.91 ▼0.4018.84 ▼35.72
Posts /wp-admin/edit.php2.91 ▼0.4518.44 ▼31.27
Add New Post /wp-admin/post-new.php2.91 ▼2.9817.40 ▼77.52
Media Library /wp-admin/upload.php2.91 ▼0.3214.76 ▼19.79
Show My Sales /wp-admin/options-general.php?page=showmysales2.9116.82

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 49 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
showmysales_options
widget_recent-posts

Browser metrics Passed 4 tests

Show My Sales: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.73 ▲0.441.71 ▼0.1844.56 ▼0.22
Dashboard /wp-admin2,213 ▲224.88 ▲0.01108.67 ▲0.6542.64 ▲0.61
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0335.04 ▼2.2833.43 ▼2.08
Add New Post /wp-admin/post-new.php1,548 ▲1518.10 ▼5.06631.91 ▼70.3449.08 ▼3.58
Media Library /wp-admin/upload.php1,392 ▲44.24 ▼0.0493.56 ▼8.2341.94 ▼2.50
Show My Sales /wp-admin/options-general.php?page=showmysales1,1982.3332.9033.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/show-my-sales/mpf/options.php+56
    Use of undefined constant on - assumed 'on' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • showmysales_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% 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=showmysales
    • > Warning in wp-content/plugins/show-my-sales/mpf/options.php+56
    Use of undefined constant on - assumed 'on' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/mpf.class.php+204
    Undefined index: action
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/notifications.php+33
    Undefined index: message
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/about.php+13
    date_default_timezone_set(): Timezone ID '' is invalid
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Deprecated in wp-content/plugins/show-my-sales/inc/sms_class.php+226
    Methods with the same name as their class will not be constructors in a future version of PHP; msms_time has a deprecated constructor
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/checkbox.php+2
    Undefined index: triggable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/select.php+2
    Undefined index: trigger
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/number.php+4
    Undefined index: min
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/number.php+4
    Undefined index: max
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/number.php+4
    Undefined index: units
    • > GET request to /wp-admin/options-general.php?page=showmysales
    • > Notice in wp-content/plugins/show-my-sales/mpf/views/closetab.php+2
    Undefined index: actions

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 14× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/show-my-sales/mpf/views/hidden.php
    • > /wp-content/plugins/show-my-sales/mpf/views/text.php
    • > /wp-content/plugins/show-my-sales/mpf/views/checkbox.php
    • > /wp-content/plugins/show-my-sales/inc/html.php
    • > /wp-content/plugins/show-my-sales/mpf/views/opentab.php
    • > /wp-content/plugins/show-my-sales/mpf/views/select.php
    • > /wp-content/plugins/show-my-sales/mpf/views/size.php
    • > /wp-content/plugins/show-my-sales/mpf/views/title.php
    • > /wp-content/plugins/show-my-sales/mpf/views/color.php
    • > /wp-content/plugins/show-my-sales/mpf/views/radio.php
  • 215× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/size.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/textarea.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/code.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/checkbox.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/editor.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/checkbox-group.php on line 2
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/show-my-sales/mpf/views/checkbox.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/show-my-sales/mpf/views/number.php on line 2
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/show-my-sales/mpf/views/editor.php on line 9
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/show-my-sales/mpf/views/textarea.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (plugin option page 1), #2 (plugin option page 2), #3 (see how it looks on mobile device)
The official readme.txt is a good inspiration

show-my-sales/show-my-sales.php 92% from 13 tests

This is the main PHP file of "Show My Sales" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 245 characters long)

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
No dangerous file extensions were detected2,651 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP293727111,833
JavaScript3138232695
CSS33322123

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity31.80
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods57
▷ Static methods915.79%
▷ Public methods5596.49%
▷ Protected methods00.00%
▷ Private methods23.51%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 compressed PNG files occupy 0.73MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
mpf/images/icons-36-white.png3.77KB4.11KB0.00%
mpf/images/icons-18-black.png1.92KB2.02KB0.00%
mpf/images/success.png0.62KB0.62KB0.00%
mpf/images/icons-36-black.png3.77KB4.09KB0.00%
mpf/images/icons-18-white.png1.76KB1.98KB0.00%