84% affiliate-reviews

Code Review | Affiliate Reviews

WordPress plugin Affiliate Reviews scored 84% from 54 tests.

About plugin

  • Plugin page: affiliate-reviews
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Mar 15, 2023
  • Latest release: Aug 17, 2023
  • Number of updates: 9
  • Update frequency: every 17.3 days
  • Top authors: wpchop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 497 total downloads

Benchmarks

Plugin footprint 83% 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.99MB] [CPU: ▲0.74ms] Passed 4 tests

Analyzing server-side resources used by Affiliate Reviews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.18 ▲0.7244.43 ▲4.14
Dashboard /wp-admin4.42 ▲1.1250.24 ▲1.07
Posts /wp-admin/edit.php4.43 ▲1.0751.64 ▲6.41
Add New Post /wp-admin/post-new.php7.30 ▲1.41105.37 ▼8.66
Media Library /wp-admin/upload.php4.28 ▲1.0553.45 ▲20.44
Reviews /wp-admin/edit.php?post_type=affreviews_reviews4.3746.23
Add New Review /wp-admin/post-new.php?post_type=affreviews_reviews4.7363.62
Categories /wp-admin/edit-tags.php?taxonomy=affreviews_tax&post_type=affreviews_reviews4.2643.52

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 490 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Affiliate Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲22320.61 ▲6.301.81 ▼0.1236.68 ▼14.06
Dashboard /wp-admin2,348 ▲16011.62 ▲6.72270.59 ▲150.7941.15 ▼3.35
Posts /wp-admin/edit.php2,254 ▲16510.23 ▲8.1780.72 ▲43.5832.58 ▼1.66
Add New Post /wp-admin/post-new.php1,585 ▲5718.90 ▲0.76569.25 ▼59.8335.64 ▼27.43
Media Library /wp-admin/upload.php1,550 ▲16210.79 ▲6.54144.48 ▲46.5258.53 ▲15.36
Reviews /wp-admin/edit.php?post_type=affreviews_reviews1,22310.2384.1027.91
Add New Review /wp-admin/post-new.php?post_type=affreviews_reviews2,49212.46154.5933.48
Categories /wp-admin/edit-tags.php?taxonomy=affreviews_tax&post_type=affreviews_reviews1,4298.9675.2426.15

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means 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
  • 69× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/types/CMB2_Type_Title.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/affiliate-reviews/templates/blocks/block-reviews-table-style.php on line 9
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/affiliate-reviews/templates/blocks/block-reviews-table-style.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/affiliate-reviews/vendor/cmb2/cmb2/includes/types/CMB2_Type_Counter_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/affiliate-reviews/templates/blocks/block-reviews-table-style-large.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: affiliate, blocks, table, reviews, fse...

affiliate-reviews/affreviews.php 85% from 13 tests

The main PHP file in "Affiliate Reviews" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("affiliate-reviews.php" instead of "affreviews.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin52,748 lines of code in 316 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,37018,56532,467
PHP962,7037,5559,400
CSS212531,1904,568
JavaScript304868482,756
Sass30429382,107
Markdown32490768
JSON1500682

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity18.35
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes78
▷ Abstract classes911.54%
▷ Concrete classes6988.46%
▷ Final classes00.00%
Methods625
▷ Static methods10917.44%
▷ Public methods52684.16%
▷ Protected methods8914.24%
▷ Private methods101.60%
Functions59
▷ Named functions5898.31%
▷ Anonymous functions11.69%
Constants14
▷ Global constants857.14%
▷ Class constants642.86%
▷ 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
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%