83% easyamazon

Code Review | Easy Amazon Affilate Partner

WordPress plugin Easy Amazon Affilate Partner scored83%from 54 tests.

About plugin

  • Plugin page: easyamazon
  • Plugin version: 1.10.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 27, 2017
  • Latest release: Sep 14, 2017
  • Number of updates: 27
  • Update frequency: every 7.3 days
  • Top authors: msar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,473 total downloads

Benchmarks

Plugin footprint 82% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.12ms] Passed 4 tests

An overview of server-side resources used by Easy Amazon Affilate Partner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1244.65 ▼1.42
Dashboard /wp-admin3.41 ▲0.0652.29 ▼20.32
Posts /wp-admin/edit.php3.52 ▲0.1654.82 ▼0.47
Add New Post /wp-admin/post-new.php5.99 ▲0.1098.89 ▲1.73
Media Library /wp-admin/upload.php3.33 ▲0.1039.89 ▲3.27
easyAmazon /wp-admin/options-general.php?page=msar_ea3.3036.23

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • You have illegally modified 1 file (0.00KB) outside of "wp-content/plugins/easyamazon/" and "wp-content/uploads/"
    • (new file) wp-content/easyAmazonCache/.empty
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_eawidgetsinglefromcache
theysaidso_admin_options
can_compress_scripts
widget_eawidget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Easy Amazon Affilate Partner
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.20 ▼0.411.82 ▲0.3044.36 ▲5.42
Dashboard /wp-admin2,199 ▲255.62 ▲0.1091.97 ▼13.9842.11 ▼1.99
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.0040.21 ▲0.4135.29 ▼1.27
Add New Post /wp-admin/post-new.php1,530 ▲422.99 ▲2.04663.33 ▼8.3552.57 ▼8.58
Media Library /wp-admin/upload.php1,404 ▲14.12 ▼0.1498.41 ▼5.7243.60 ▲1.66
easyAmazon /wp-admin/options-general.php?page=msar_ea9032.1227.1829.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_eawidget
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_eawidgetsinglefromcache
    • widget_recent-comments

Smoke tests 75% 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easyamazon/views/eaAuthorOption.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/easyamazon/classes/eaWidgetSingleFromCache.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_filter() in wp-content/plugins/easyamazon/easy-amazon.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easyamazon/views/eaOptionsPage.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/easyamazon/classes/eaWidgetSingle.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: product information, affilate, amazon

easyamazon/easy-amazon.php 85% from 13 tests

The main PHP script in "Easy Amazon Affilate Partner" version 1.10.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("easyamazon.php" instead of "easy-amazon.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 199 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,206 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP14108265755
CSS1613451

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity16.60
▷ Minimum class complexity7.00
▷ Maximum class complexity39.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods42
▷ Static methods716.67%
▷ Public methods3583.33%
▷ Protected methods24.76%
▷ Private methods511.90%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/prime.png3.57KB1.55KB▼ 56.53%