58% super-metronic

Code Review | Super Metronic

WordPress plugin Super Metronic scored58%from 54 tests.

About plugin

  • Plugin page: super-metronic
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.1-4.8.1
  • WordPress version: 6.3.1
  • First release: May 31, 2016
  • Latest release: Aug 10, 2017
  • Number of updates: 4
  • Update frequency: every 109.0 days
  • Top authors: BigTonny (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /624 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.82ms] Passed 4 tests

Analyzing server-side resources used by Super Metronic
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0437.62 ▼1.11
Dashboard /wp-admin3.40 ▲0.1047.54 ▲0.46
Posts /wp-admin/edit.php3.52 ▲0.1647.80 ▲2.62
Add New Post /wp-admin/post-new.php5.98 ▲0.1082.44 ▼2.51
Media Library /wp-admin/upload.php3.32 ▲0.1035.12 ▼4.13
Activate /wp-admin/admin.php?page=portlets3.3436.29
Customize /wp-admin/admin.php?page=portlets-customize3.3739.63

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 150 new files
Database: 1 new table, 6 new options
New tables
wp_portlets
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Super Metronic
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲17213.57 ▼0.829.75 ▲7.3676.50 ▲33.11
Dashboard /wp-admin2,228 ▲435.79 ▲0.77112.27 ▲10.0078.77 ▲33.24
Posts /wp-admin/edit.php2,114 ▲252.00 ▼0.0134.41 ▼2.0432.78 ▲0.04
Add New Post /wp-admin/post-new.php1,542 ▲923.27 ▼0.01712.99 ▼25.7361.44 ▲6.19
Media Library /wp-admin/upload.php1,407 ▲224.12 ▲0.03111.55 ▲4.0749.15 ▲2.16
Activate /wp-admin/admin.php?page=portlets1,0363.3952.8296.47
Customize /wp-admin/admin.php?page=portlets-customize9,8743.96109.9467.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstaller has failed for this plugin, leaving 150 files (4.14MB) in the plugin directory
    • (new file) assets/css/fonts/2211.ttf
    • (new file) assets/css/front.css
    • (new file) assets/css/admin-activate.css
    • (new file) 4.jpg
    • (new file) 3.jpg
    • (new file) 1.jpg
    • (new file) assets/css/admin-customize.css
    • (new file) assets/global/css/components.min.css
    • (new file) 2.jpg
    • (new file) assets/css/common.css
    • ...
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_portlets
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 121× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/Abstract.php on line 27
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/Date.php on line 27
    • > PHP Warning
      require_once(Zend/Validate/Abstract.php): failed to open stream: No such file or directory in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/File/ImageSize.php on line 25
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Uri/Http.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Http/Client/Adapter/Socket.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Uri.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Uri/Http.php on line 25
    • > PHP Warning
      require_once(Zend/Validate/Hostname/Interface.php): failed to open stream: No such file or directory in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/Hostname/Li.php on line 27
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Http/Client.php on line 27
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/File/MimeType.php on line 25
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/Barcode/UpcA.php on line 27
    • > PHP Warning
      require_once(Zend/Validate/Abstract.php): failed to open stream: No such file or directory in wp-content/plugins/super-metronic/includes/phpQuery/phpQuery/Zend/Validate/Date.php on line 27

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portlets-customize
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/super-metronic/assets/js/admin.js?ver=6.3.1:5:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portlets-customize
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Create a new portlet. The choice of color.), #2 (Clearance of the porlet. You can add details.), #3 (The list of ready portlets in the admin panel.), #4 (The list of activated portlets on a user page.)
You can take inspiration from this readme.txt

super-metronic/class-super-metronic.php 85% from 13 tests

The main PHP file in "Super Metronic" ver. 1.1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("super-metronic.php" instead of "class-super-metronic.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin14,866 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
PHP881,5417,9279,501
SVG4003,666
JavaScript122011651,066
CSS142660555
PO File1273378

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity22.43
▷ Minimum class complexity1.00
▷ Maximum class complexity555.00
Average method complexity4.01
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces4
Traits0
Classes82
▷ Abstract classes89.76%
▷ Concrete classes7490.24%
▷ Final classes00.00%
Methods626
▷ Static methods14723.48%
▷ Public methods53184.82%
▷ Protected methods8513.58%
▷ Private methods101.60%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants109
▷ Global constants43.67%
▷ Class constants10596.33%
▷ Public constants105100.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
6 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/global/plugins/trumbowyg/ui/images/icons-white.png7.03KB2.96KB▼ 57.89%
assets/global/plugins/trumbowyg/ui/images/icons-black-2x.png14.79KB4.95KB▼ 66.51%
assets/global/plugins/trumbowyg/ui/images/icons-white-2x.png13.48KB4.79KB▼ 64.51%
assets/img/icon.png0.70KB0.63KB▼ 9.74%
assets/global/img/remove-icon-small.png0.19KB0.19KB0.00%