10% affiliate-press

Code Review | Affiliate Press

WordPress plugin Affiliate Press scored10%from 54 tests.

About plugin

  • Plugin page: affiliate-press
  • Plugin version: 0.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4
  • WordPress version: 6.3.1
  • First release: Apr 6, 2012
  • Latest release: Apr 19, 2012
  • Number of updates: 21
  • Update frequency: every 0.8 days
  • Top authors: ldebrouwer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,920 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/affiliate-press/includes/class-items-table.php+182
    Declaration of itemsTable::prepare_items($data) should be compatible with WP_List_Table::prepare_items()

Server metrics [RAM: ▼1.96MB] [CPU: ▼48.96ms] Passed 4 tests

Analyzing server-side resources used by Affiliate Press
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.94 ▼32.43
Dashboard /wp-admin2.05 ▼1.256.45 ▼40.20
Posts /wp-admin/edit.php2.05 ▼1.315.32 ▼40.82
Add New Post /wp-admin/post-new.php2.05 ▼3.845.88 ▼82.38
Media Library /wp-admin/upload.php2.05 ▼1.187.59 ▼25.97
Feeds /wp-admin/admin.php?page=affiliate_press_feeds2.055.98
Add New Feed /wp-admin/admin.php?page=affiliate_press_add2.055.57
Dashboard /wp-admin/admin.php?page=affiliate_press2.056.98
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=product2.056.28
Add New /wp-admin/post-new.php?post_type=product2.056.09
All Products /wp-admin/edit.php?post_type=product2.056.36
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=product2.056.60
Add New Feed Wizard /wp-admin/admin.php?page=affiliate_press_add_wizard2.055.45

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 28 new files
Database: 2 new tables, 9 new options
New tables
wp_apfeeds
wp_apprices
New WordPress options
db_upgraded
theysaidso_admin_options
category_children
widget_recent-posts
widget_recent-comments
LDB_Affiliate_Press_Version
can_compress_scripts
widget_theysaidso_widget
LDB_Affiliate_Press_Pointers

Browser metrics Passed 4 tests

A check of browser resources used by Affiliate Press
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲13913.55 ▼1.031.72 ▼0.0640.10 ▼6.21
Dashboard /wp-admin2,280 ▲924.96 ▼0.94100.23 ▼14.9887.64 ▲46.87
Posts /wp-admin/edit.php2,160 ▲682.05 ▲0.0236.06 ▼1.5131.86 ▼2.64
Add New Post /wp-admin/post-new.php1,754 ▲24022.91 ▲5.38697.76 ▲49.5330.87 ▼13.03
Media Library /wp-admin/upload.php1,459 ▲714.27 ▲0.0897.24 ▲3.6078.09 ▲36.88
Feeds /wp-admin/admin.php?page=affiliate_press_feeds1,1934.7851.6165.41
Add New Feed /wp-admin/admin.php?page=affiliate_press_add1,2304.8857.4765.29
Dashboard /wp-admin/admin.php?page=affiliate_press1,1044.7653.8170.08
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=product1,3782.2226.9031.82
Add New /wp-admin/post-new.php?post_type=product2,90210.35205.62117.57
All Products /wp-admin/edit.php?post_type=product1,2551.9533.4231.07
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=product1,5142.3525.7136.52
Add New Feed Wizard /wp-admin/admin.php?page=affiliate_press_add_wizard1,0614.7246.4546.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/affiliate-press/includes/class-items-table.php+182
    Declaration of itemsTable::prepare_items($data) should be compatible with WP_List_Table::prepare_items()
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_apfeeds
    • wp_apprices
  • This plugin does not fully uninstall, leaving 9 options in the database
    • LDB_Affiliate_Press_Version
    • LDB_Affiliate_Press_Pointers
    • category_children
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=affiliate_press_add_wizard
    • > Warning in wp-content/plugins/affiliate-press/includes/class-items-table.php+182
    Declaration of itemsTable::prepare_items($data) should be compatible with WP_List_Table::prepare_items()

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
Almost there! Just fix the following items
  • 19× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-press/views/sidebar.php:5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/affiliate-press/includes/class-items-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-press/views/feed-add.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-press/views/feed-index.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/affiliate-press/includes/class-feeds-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-press/views/feed-linkto.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliate-press/includes/class-feeds-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-press/views/feed-edit.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-press/views/feed-view.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/affiliate-press/includes/class-items-table.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: feeds, affiliate, affiliates, product, product feeds...

affiliate-press/affiliate-press.php Passed 13 tests

The primary PHP file in "Affiliate Press" version 0.3.8 is used by WordPress to initiate all plugin functionality
98 characters long description:
Affiliate Press allows you to set up an affiliate website based on product feeds as easy as 1-2-3.

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 plugin1,576 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17123681,439
CSS1290128
JavaScript2009

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity36.00
▷ Minimum class complexity8.00
▷ Maximum class complexity126.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods64100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/facebook.png1.54KB1.00KB▼ 35.06%
images/icon32.png1.92KB0.64KB▼ 66.84%
images/close.png1.11KB0.23KB▼ 78.80%
images/mail.png1.41KB0.82KB▼ 41.63%
images/icon16.png1.31KB0.39KB▼ 70.42%