78% amazonjs

Code Review | Amazon JS

WordPress plugin Amazon JS scored 78% from 54 tests.

About plugin

  • Plugin page: amazonjs
  • Plugin version: 0.10
  • PHP compatiblity: 5.3.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.5
  • WordPress version: 5.8.1
  • First release: Dec 29, 2010
  • Latest release: Nov 20, 2019
  • Number of updates: 40
  • Update frequency: every 82.8 days
  • Top authors: makoto_kw (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active / 139,211 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.08MB] [CPU: ▼185.77ms] Passed 4 tests

An overview of server-side resources used by Amazon JS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.53 ▼0.3118.18 ▼28.33
Dashboard /wp-admin2.58 ▼0.4912.09 ▼26.78
Posts /wp-admin/edit.php2.58 ▼0.5312.18 ▼18.93
Add New Post /wp-admin/post-new.php2.58 ▼2.8611.01 ▼669.04
Media Library /wp-admin/upload.php2.58 ▼0.4311.21 ▼11.53
AmazonJS /wp-admin/options-general.php?page=amazonjs2.5810.97

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Amazon JS
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲7715.91 ▲0.124.85 ▼0.8074.74 ▼1.24
Dashboard /wp-admin2,940 ▲476.12 ▼0.05114.43 ▼16.09160.71 ▼18.58
Posts /wp-admin/edit.php2,750 ▲103.24 ▼0.0064.96 ▼1.62138.18 ▼3.27
Add New Post /wp-admin/post-new.php3,743 ▼7018.90 ▼0.23456.09 ▲11.17160.56 ▼0.57
Media Library /wp-admin/upload.php1,758 ▲65.50 ▼0.03149.30 ▲12.83183.57 ▲3.06
AmazonJS /wp-admin/options-general.php?page=amazonjs1,4342.3656.05134.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/amazonjs/amazonjs.php+439
    Undefined index: defaults

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 19 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=amazonjs
    • > Notice in wp-content/plugins/amazonjs/amazonjs.php+439
    Undefined index: defaults
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=amazonjs
    • > Notice in wp-content/plugins/amazonjs/amazonjs.php+748
    Undefined index: placeholder
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=amazonjs
    • > Notice in wp-content/plugins/amazonjs/amazonjs.php+761
    Undefined index: description

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/amazonjs/media-upload-type-amazonjs.php:8

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 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Click the gray Amazon icon to go to search form in editing entry page.) image missing
The official readme.txt might help

amazonjs/amazonjs.php Passed 13 tests

"Amazon JS" version 0.10's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
100 characters long description:
Easy to use interface to add an amazon product to your post and display it by using jQuery template.

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
There were no executable files found in this plugin4,110 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP83304302,897
JavaScript31214443
CSS492374
PO File1144146373
Markdown115023

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity48.43
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods98
▷ Static methods2020.41%
▷ Public methods7879.59%
▷ Protected methods33.06%
▷ Private methods1717.35%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants753.85%
▷ Class constants646.15%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/amazonjs.png1.77KB1.33KB▼ 25.18%
screenshot-1.png12.23KB5.55KB▼ 54.64%
images/amazon-icon.png0.49KB0.47KB▼ 3.39%