84% associatebox-for-amazon

Code Review | AssociateBox for Amazon

WordPress plugin AssociateBox for Amazon scored 84% from 54 tests.

About plugin

  • Plugin page: associatebox-for-...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Apr 5, 2016
  • Latest release: Jun 27, 2016
  • Number of updates: 89
  • Update frequency: every 2.8 days
  • Top authors: mstemberg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 867 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▼0.71MB] [CPU: ▼21.37ms] Passed 4 tests

This is a short check of server-side resources used by AssociateBox for Amazon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.62 ▼3.40
Dashboard /wp-admin3.21 ▼0.0932.27 ▼18.32
Posts /wp-admin/edit.php3.37 ▲0.0147.81 ▲0.14
Add New Post /wp-admin/post-new.php3.15 ▼2.7439.57 ▼61.81
Media Library /wp-admin/upload.php3.21 ▼0.0131.80 ▼1.95

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_associatebox_widget
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for AssociateBox for Amazon
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7913.29 ▼1.361.81 ▼0.0443.57 ▼5.52
Dashboard /wp-admin2,223 ▲355.84 ▲0.9494.93 ▼19.6139.71 ▼8.51
Posts /wp-admin/edit.php2,103 ▲142.05 ▲0.0133.95 ▼0.9533.98 ▼1.24
Add New Post /wp-admin/post-new.php7,117 ▲5,59823.32 ▲0.25850.43 ▲185.9481.09 ▲9.15
Media Library /wp-admin/upload.php1,402 ▲144.28 ▲0.1094.93 ▼7.2842.58 ▼3.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_associatebox_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/associatebox-for-amazon/associatebox_widget.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/associatebox-for-amazon/associatebox_widget.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: associatebox, amazon articles, earn money, associate program

associatebox-for-amazon/associate_box.php 85% from 13 tests

Analyzing the main PHP file in "AssociateBox for Amazon" version 1.5
Please take the time to fix the following:
  • 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
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("associatebox-for-amazon.php" instead of "associate_box.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,527 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2472741,247
PO File17679179
CSS13715101

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity10.25
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin