62% wg-compareo

Code Review | WG Compareo

WordPress plugin WG Compareo scored62%from 54 tests.

About plugin

  • Plugin page: wg-compareo
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.2
  • WordPress version: 6.3.1
  • First release: May 16, 2018
  • Latest release: Sep 2, 2019
  • Number of updates: 12
  • Update frequency: every 39.6 days
  • Top authors: webgensis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /584 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.74MB] [CPU: ▼37.66ms] Passed 4 tests

An overview of server-side resources used by WG Compareo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2843.13 ▲2.57
Dashboard /wp-admin3.21 ▼0.1024.01 ▼27.08
Posts /wp-admin/edit.php3.21 ▼0.1523.74 ▼26.30
Add New Post /wp-admin/post-new.php3.21 ▼2.6820.68 ▼77.43
Media Library /wp-admin/upload.php3.21 ▼0.0218.30 ▼19.84
Add New Image Compare /wp-admin/post-new.php?post_type=compare3.2122.29
All Image Compare /wp-admin/edit.php?post_type=compare3.2119.99

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WG Compareo
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20213.43 ▼0.948.47 ▲6.6437.12 ▼5.22
Dashboard /wp-admin2,236 ▲595.68 ▲0.1086.22 ▼3.9839.30 ▼3.21
Posts /wp-admin/edit.php2,141 ▲382.03 ▲0.0237.65 ▼4.7433.22 ▼8.86
Add New Post /wp-admin/post-new.php1,556 ▲1823.68 ▲5.41692.70 ▲67.0071.04 ▲7.12
Media Library /wp-admin/upload.php1,438 ▲354.30 ▲0.11103.04 ▼2.9843.87 ▼4.61
Add New Image Compare /wp-admin/post-new.php?post_type=compare1,2931.516.7433.70
All Image Compare /wp-admin/edit.php?post_type=compare1,1021.9735.0131.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/wg-compareo/wg-compareo.php+165
    Use of undefined constant WG_IGHE_POST_TYPE - assumed 'WG_IGHE_POST_TYPE' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 7 options in the database
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=compare
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/wg-compareo/wg-compareo.php+186
    Use of undefined constant WG_IGHE_POST_TYPE - assumed 'WG_IGHE_POST_TYPE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/post-new.php?post_type=compare
    • > Compile error in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_File.php+15
    Declaration of CMB2_Type_File::render() must be compatible with CMB2_Type_Text::render($args = Array)

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
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wg-compareo/inc/index.php
    • > /wp-content/plugins/wg-compareo/images/index.php
    • > /wp-content/plugins/wg-compareo/index.php
  • 35× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/wg-compareo/inc/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/wg-compareo/inc/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Donate link: Invalid url: "www.webgensis.com"
You can look at the official readme.txt

wg-compareo/wg-compareo.php Passed 13 tests

The primary PHP file in "WG Compareo" version 1.0 is used by WordPress to initiate all plugin functionality
86 characters long description:
Create attractive image compare boxes. Place them anywhere with easy to use shortcode.

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
No dangerous file extensions were detected43,547 lines of code in 195 files:
LanguageFilesBlank linesComment linesLines of code
PO File12013,78217,88231,544
PHP521,7284,6745,967
CSS131,0021,0344,469
JavaScript52843071,058
Markdown21440428
SVG30381

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity16.43
▷ Minimum class complexity1.00
▷ Maximum class complexity141.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes812.70%
▷ Concrete classes5587.30%
▷ Final classes00.00%
Methods430
▷ Static methods6715.58%
▷ Public methods35983.49%
▷ Protected methods6815.81%
▷ Private methods30.70%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants960.00%
▷ Class constants640.00%
▷ Public constants6100.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
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
inc/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
inc/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
inc/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
inc/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%