74% i2-azon

Code Review | i2 AZON

WordPress plugin i2 AZON scored74%from 54 tests.

About plugin

  • Plugin page: i2-azon
  • Plugin version: 0.2.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 21, 2021
  • Latest release: Apr 6, 2021
  • Number of updates: 6
  • Update frequency: every 13.5 days
  • Top authors: imibrar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /1,269 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼17.15ms] Passed 4 tests

This is a short check of server-side resources used by i2 AZON
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4741.21 ▼2.29
Dashboard /wp-admin3.81 ▲0.4647.37 ▼11.05
Posts /wp-admin/edit.php3.86 ▲0.5048.33 ▼2.22
Add New Post /wp-admin/post-new.php5.48 ▼0.4056.02 ▼53.03
Media Library /wp-admin/upload.php3.67 ▲0.4438.08 ▲2.90
Images /wp-admin/edit.php?post_type=i2_azon_image3.7138.19
Setting /wp-admin/admin.php?page=i2_azon_setting_page3.6430.60
Product Box /wp-admin/edit.php?post_type=i2_azon_product_box3.7136.77

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 32 new files
Database: 1 new table, 7 new options
New tables
wp_i2_azon_items
New WordPress options
i2_azon_db_version
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for i2 AZON
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.72 ▲0.441.55 ▲0.0244.62 ▲0.09
Dashboard /wp-admin2,219 ▲425.58 ▼0.0591.53 ▲0.9941.20 ▼1.44
Posts /wp-admin/edit.php2,127 ▲241.96 ▼0.0738.90 ▼0.8637.15 ▼0.01
Add New Post /wp-admin/post-new.php6,229 ▲4,70319.04 ▼4.60916.88 ▲249.8652.92 ▲0.37
Media Library /wp-admin/upload.php1,424 ▲274.13 ▼0.04106.80 ▼15.8945.51 ▼5.15
Images /wp-admin/edit.php?post_type=i2_azon_image1,0991.9731.8541.43
Setting /wp-admin/admin.php?page=i2_azon_setting_page1,0752.1823.6924.96
Product Box /wp-admin/edit.php?post_type=i2_azon_product_box1,0991.9230.9333.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_i2_azon_items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • i2_azon_db_version
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/i2-azon/include/register-post-types.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/i2-azon/include/rest-api.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots need descriptions #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in i2-azon/assets to your readme.txt
The official readme.txt might help

i2-azon/i2-azon.php 92% from 13 tests

"i2 AZON" version 0.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,871 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP123162131,856
SVG30110
JavaScript2063
CSS2482

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity30.33
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods72
▷ Static methods22.78%
▷ Public methods6083.33%
▷ Protected methods34.17%
▷ Private methods912.50%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/5-stars-80.png1.29KB1.18KB▼ 8.42%
dist/images/5-stars-gray-80.png1.32KB1.18KB▼ 10.64%
dist/images/a-prime-60.png1.33KB1.27KB▼ 4.26%
dist/images/a-fulfillment-60.png3.08KB1.70KB▼ 44.76%