84% icompare

Code Review | iCompare

WordPress plugin iCompare scored84%from 54 tests.

About plugin

  • Plugin page: icompare
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.3
  • WordPress version: 6.3.1
  • First release: Oct 8, 2015
  • Latest release: Feb 8, 2016
  • Number of updates: 24
  • Update frequency: every 5.2 days
  • Top authors: OnChow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,208 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼11.39ms] Passed 4 tests

Analyzing server-side resources used by iCompare
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2140.89 ▲5.24
Dashboard /wp-admin3.52 ▲0.1743.78 ▼18.42
Posts /wp-admin/edit.php3.64 ▲0.2846.78 ▼4.62
Add New Post /wp-admin/post-new.php5.65 ▼0.2470.01 ▼25.73
Media Library /wp-admin/upload.php3.44 ▲0.2139.60 ▲3.21

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

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

Browser metrics Passed 4 tests

A check of browser resources used by iCompare
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲4913.25 ▼1.026.51 ▲4.5342.80 ▼4.60
Dashboard /wp-admin2,219 ▲274.90 ▼0.06101.80 ▼12.1339.19 ▼6.17
Posts /wp-admin/edit.php2,102 ▲102.01 ▲0.0438.02 ▲3.0636.32 ▲2.65
Add New Post /wp-admin/post-new.php6,229 ▲4,69318.71 ▼4.48909.82 ▲219.3161.04 ▲1.92
Media Library /wp-admin/upload.php1,407 ▲254.25 ▲0.0697.57 ▼8.2440.95 ▼3.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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 items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/icompare/icompare.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/icompare/options-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/icompare/meta-box.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/icompare/aws_lib/amazon_api_class.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: products, compare, comparer

icompare/icompare.php 92% from 13 tests

The entry point to "iCompare" version 1.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 190 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,462 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP72252441,132
CSS223243
JavaScript2141287

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ebay.png2.27KB1.84KB▼ 19.02%
img/ribbon_red_left_top.png4.36KB1.24KB▼ 71.63%
img/ali-express.png3.41KB2.43KB▼ 28.63%
img/amazon.png1.96KB0.84KB▼ 56.99%