10% dreamhost-affiliates

Code Review | Affiliate Integration Dreamhost

WordPress plugin Affiliate Integration Dreamhost scored 10% from 54 tests.

About plugin

  • Plugin page: dreamhost-affiliates
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Oct 4, 2012
  • Latest release: Oct 5, 2012
  • Number of updates: 15
  • Update frequency: N/A
  • Top authors: jprummer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,625 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
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/dreamhost-affiliates/dreamer.php+247
    Methods with the same name as their class will not be constructors in a future version of PHP; Dreamer_Widget has a deprecated constructor

Server metrics [RAM: ▼1.86MB] [CPU: ▼53.93ms] Passed 4 tests

This is a short check of server-side resources used by Affiliate Integration Dreamhost
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.334.51 ▼38.66
Dashboard /wp-admin2.16 ▼1.156.05 ▼41.91
Posts /wp-admin/edit.php2.16 ▼1.206.87 ▼45.89
Add New Post /wp-admin/post-new.php2.16 ▼3.735.30 ▼89.27
Media Library /wp-admin/upload.php2.16 ▼1.085.78 ▼28.92
Dreamhost Affiliate Setup /wp-admin/options-general.php?page=dreamer_options_page2.165.44

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Affiliate Integration Dreamhost
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▼0.101.72 ▼0.0338.49 ▼1.74
Dashboard /wp-admin2,213 ▲254.84 ▼0.02111.38 ▼4.9145.47 ▲6.03
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0340.19 ▼0.7134.93 ▲0.24
Add New Post /wp-admin/post-new.php1,540 ▲2123.40 ▲0.40653.49 ▼44.2958.80 ▲0.18
Media Library /wp-admin/upload.php1,389 ▲74.19 ▼0.0497.91 ▼2.2942.10 ▼1.61
Dreamhost Affiliate Setup /wp-admin/options-general.php?page=dreamer_options_page1,1971.6929.7736.29

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/dreamhost-affiliates/dreamer.php+247
    Methods with the same name as their class will not be constructors in a future version of PHP; Dreamer_Widget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_dreamer_widget
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • 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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=dreamer_options_page
    • > Deprecated in wp-content/plugins/dreamhost-affiliates/dreamer.php+247
    Methods with the same name as their class will not be constructors in a future version of PHP; Dreamer_Widget has a deprecated constructor
  • 43 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dreamer_options_page
    • > Notice in wp-content/plugins/dreamhost-affiliates/dreamer.php+156
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=dreamer_options_page
    • > Deprecated in wp-content/plugins/dreamhost-affiliates/dreamer.php+286
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=dreamer_options_page
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Dreamer_Widget is deprecated since version 4.3.0! Use __construct() instead.

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_action() in wp-content/plugins/dreamhost-affiliates/dreamer.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #3 (Shows a banner in action.), #4 (Demonstration of the [dreamer] shortcode integration.)
  • Plugin Name: Please specify the plugin name on the first line ( === dreamhost-affiliates === )
The official readme.txt might help

dreamhost-affiliates/dreamer.php 85% from 13 tests

This is the main PHP file of "Affiliate Integration Dreamhost" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 359 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dreamhost-affiliates.php" instead of "dreamer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected244 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11826244

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin