10% wpx-affiliate-manager

Code Review | WPX Affiliate Manager

WordPress plugin WPX Affiliate Manager scored10%from 54 tests.

About plugin

  • Plugin page: wpx-affiliate-man...
  • Plugin version: 0.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.4
  • WordPress version: 6.3.1
  • First release: Feb 10, 2012
  • Latest release: Jun 27, 2012
  • Number of updates: 12
  • Update frequency: every 11.5 days
  • Top authors: wpxprt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,871 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/wpx-affiliate-manager/wpx-affiliate-manager.php+309
    Methods with the same name as their class will not be constructors in a future version of PHP; wpx_am_widget has a deprecated constructor

Server metrics [RAM: ▼1.87MB] [CPU: ▼56.35ms] Passed 4 tests

Analyzing server-side resources used by WPX Affiliate Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.354.54 ▼37.43
Dashboard /wp-admin2.14 ▼1.176.79 ▼47.89
Posts /wp-admin/edit.php2.14 ▼1.225.51 ▼47.59
Add New Post /wp-admin/post-new.php2.14 ▼3.755.82 ▼92.48
Media Library /wp-admin/upload.php2.14 ▼1.094.87 ▼29.08
WPX Affiliate Manager /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php2.146.11

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_wpx_am_widget

Browser metrics Passed 4 tests

WPX Affiliate Manager: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.42 ▲0.141.90 ▲0.2945.56 ▲1.14
Dashboard /wp-admin2,195 ▲155.54 ▼0.1388.10 ▲2.1637.19 ▼4.28
Posts /wp-admin/edit.php2,103 ▲31.98 ▼0.0134.70 ▼8.0937.45 ▼6.46
Add New Post /wp-admin/post-new.php1,531 ▲323.35 ▲0.20677.83 ▼16.2460.92 ▲1.93
Media Library /wp-admin/upload.php1,406 ▲64.21 ▼0.00102.02 ▼10.7942.28 ▼6.57
WPX Affiliate Manager /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php1,1132.0328.6227.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wpx-affiliate-manager/wpx-affiliate-manager.php+309
    Methods with the same name as their class will not be constructors in a future version of PHP; wpx_am_widget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_wpx_am_widget
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php
    • > Deprecated in wp-content/plugins/wpx-affiliate-manager/wpx-affiliate-manager.php+309
    Methods with the same name as their class will not be constructors in a future version of PHP; wpx_am_widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php
    • > Deprecated in wp-content/plugins/wpx-affiliate-manager/wpx-affiliate-manager.php+392
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wpx_am_widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wpx-affiliate-manager/wpx-affiliate-manager.php
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wpx-affiliate-manager/wpx-affiliate-manager.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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 require attention:
  • Screenshots: These screenshots do not have images: #1 (Widget configuration display), #2 (Widget Output)
Please take inspiration from this readme.txt

wpx-affiliate-manager/wpx-affiliate-manager.php Passed 13 tests

The entry point to "WPX Affiliate Manager" version 0.4.1 is a PHP file that has certain tags in its header comment area
118 characters long description:
WPX Affiliate Manager allows you to integrate affiliate 125 x 125 images side by side into your site through a widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin352 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15122321
JavaScript12018
CSS12013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png99.97KB38.37KB▼ 61.62%
screenshot-1.png28.44KB15.27KB▼ 46.32%