84% amazonsimpleadmin

Code Review | Affiliate Super Assistent

WordPress plugin Affiliate Super Assistent scored84%from 54 tests.

About plugin

  • Plugin page: amazonsimpleadmin
  • Plugin version: 1.5.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1-6.3
  • WordPress version: 6.3.1
  • First release: Jan 6, 2008
  • Latest release: Aug 12, 2023
  • Number of updates: 402
  • Update frequency: every 14.2 days
  • Top authors: worschtebrot (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

3,000+ active /176,123 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.22MB] [CPU: ▲13.78ms] Passed 4 tests

Server-side resources used by Affiliate Super Assistent
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.70 ▲2.2461.64 ▲19.80
Dashboard /wp-admin5.52 ▲2.2269.48 ▲15.65
Posts /wp-admin/edit.php5.64 ▲2.2867.51 ▲16.42
Add New Post /wp-admin/post-new.php8.10 ▲2.22112.94 ▲3.26
Media Library /wp-admin/upload.php5.44 ▲2.2157.29 ▲22.36
Affiliate Simple Assistent (ASA1) /wp-admin/options-general.php?page=amazonsimpleadmin/amazonsimpleadmin.php5.4271.22

Server storage [IO: ▲3.98MB] [DB: ▲0.11MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 568 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_amazonsimpleadmin
can_compress_scripts
_asa_cache_active
_asa_cache_skip_on_admin
db_upgraded
theysaidso_admin_options
widget_recent-posts
_asa_first_activation

Browser metrics Passed 4 tests

This is an overview of browser requirements for Affiliate Super Assistent
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3314.35 ▼0.021.95 ▲0.1738.62 ▼7.90
Dashboard /wp-admin2,203 ▲235.57 ▼0.0887.85 ▼7.1038.80 ▼2.72
Posts /wp-admin/edit.php2,105 ▲81.97 ▲0.0235.91 ▼1.1730.61 ▼6.05
Add New Post /wp-admin/post-new.php1,539 ▲1318.00 ▼5.63635.63 ▼13.4663.76 ▲7.26
Media Library /wp-admin/upload.php1,408 ▲144.34 ▲0.1398.45 ▲1.4744.94 ▲4.66
Affiliate Simple Assistent (ASA1) /wp-admin/options-general.php?page=amazonsimpleadmin/amazonsimpleadmin.php1,7374.04109.5645.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_amazonsimpleadmin

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 851× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ASA_LIB_DIR - assumed 'ASA_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amazonsimpleadmin/lib/AsaZend/Validate/File/NotExists.php on line 25
    • > PHP Fatal error
      require_once(): Failed opening required 'ASA_LIB_DIRAsaZend/Http/Client/Exception.php' (include_path='.:/usr/share/php') in wp-content/plugins/amazonsimpleadmin/lib/AsaZend/Http/Client/Adapter/Exception.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required 'ASA_LIB_DIRAsaZend/Controller/Router/Route/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/amazonsimpleadmin/lib/AsaZend/Rest/Route.php on line 25
    • > PHP Warning
      Use of undefined constant ASA_LIB_DIR - assumed 'ASA_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amazonsimpleadmin/lib/Asa/Service/Amazon/Request/Socket.php on line 11
    • > PHP Warning
      Use of undefined constant ASA_LIB_DIR - assumed 'ASA_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amazonsimpleadmin/vendor/composer/autoload_static.php on line 230
    • > PHP Fatal error
      require_once(): Failed opening required 'ASA_LIB_DIRAsaZend/Validate/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/amazonsimpleadmin/lib/AsaZend/Validate/Iban.php on line 25
    • > PHP Warning
      Use of undefined constant ASA_LIB_DIR - assumed 'ASA_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amazonsimpleadmin/lib/Asa/Service/Amazon/Debug.php on line 11
    • > PHP Warning
      require_once(ASA_LIB_DIRAsaZend/Service/Amazon/Authentication.php): failed to open stream: No such file or directory in wp-content/plugins/amazonsimpleadmin/lib/AsaZend/Service/Amazon/Authentication/S3.php on line 26
    • > PHP Fatal error
      Uncaught Error: Interface 'AsaAmazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/amazonsimpleadmin/lib/AsaAmazon/com/amazon/paapi5/v1/ContentInfo.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'ASA_LIB_DIRAsaZend/Crypt/Math/BigInteger.php' (include_path='.:/usr/share/php') in wp-content/plugins/amazonsimpleadmin/lib/AsaZend/Crypt/Math.php on line 26

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 96% 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
7 plugin tags: monetize, collections, marketing, affiliate, amazon...

amazonsimpleadmin/amazonsimpleadmin.php 92% from 13 tests

The primary PHP file in "Affiliate Super Assistent" version 1.5.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 277 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin57,741 lines of code in 478 files:
LanguageFilesBlank linesComment linesLines of code
PHP42810,30238,72950,112
Markdown101,00603,211
PO File58871,0182,344
CSS8119131,175
JSON600468
HTML18120315
JavaScript2130107
make1409

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity14.09
▷ Minimum class complexity1.00
▷ Maximum class complexity422.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces11
Interfaces26
Traits2
Classes377
▷ Abstract classes143.71%
▷ Concrete classes36396.29%
▷ Final classes82.20%
Methods3,955
▷ Static methods59014.92%
▷ Public methods3,60191.05%
▷ Protected methods2085.26%
▷ Private methods1463.69%
Functions187
▷ Named functions8545.45%
▷ Anonymous functions10254.55%
Constants599
▷ Global constants40.67%
▷ Class constants59599.33%
▷ Public constants595100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 compressed PNG files occupy 0.38MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/asa2-banner-cache.png20.75KB19.72KB▼ 4.97%
img/asa2-collections.png16.49KB15.68KB▼ 4.92%
img/asa2-banner-default.png33.20KB32.67KB▼ 1.60%
img/faq.png0.37KB0.26KB▼ 29.66%
img/whatsnew/tpl_flat_box_horizontal.png30.89KB29.01KB▼ 6.11%