73% wp-affiliate-disclosure

Code Review | WP Affiliate Disclosure

WordPress plugin WP Affiliate Disclosure scored73%from 54 tests.

About plugin

  • Plugin page: wp-affiliate-disc...
  • Plugin version: 1.2.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Nov 15, 2018
  • Latest release: Nov 5, 2023
  • Number of updates: 18
  • Update frequency: every 100.9 days
  • Top authors: mojofywp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /19,555 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲5.12MB] [CPU: ▲20.64ms] 75% from 4 tests

Analyzing server-side resources used by WP Affiliate Disclosure
Please take the time to fix the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.12MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.92 ▲5.4664.58 ▲23.50
Dashboard /wp-admin8.94 ▲5.6077.57 ▲17.50
Posts /wp-admin/edit.php8.94 ▲5.5980.25 ▲29.85
Add New Post /wp-admin/post-new.php9.71 ▲3.83110.07 ▲11.69
Media Library /wp-admin/upload.php8.94 ▲5.7172.33 ▲38.48
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9463.46

Server storage [IO: ▲5.63MB] [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: 255 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
fs_active_plugins
fs_debug_mode
fs_accounts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WP Affiliate Disclosure
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,005 ▲24314.99 ▲0.841.52 ▼0.1727.08 ▼12.32
Dashboard /wp-admin2,406 ▲2266.43 ▲0.76121.15 ▲34.0243.14 ▲2.79
Posts /wp-admin/edit.php2,348 ▲2453.52 ▲1.5259.93 ▲16.2639.22 ▲3.92
Add New Post /wp-admin/post-new.php1,459 ▼6718.04 ▼5.45611.66 ▼25.1836.36 ▼13.03
Media Library /wp-admin/upload.php1,478 ▲814.42 ▲0.2085.81 ▼22.2444.63 ▼0.89
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,3073.4153.6329.97

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
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wp-affiliate-disclosure/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • fs_active_plugins
    • fs_accounts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • fs_debug_mode

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-affiliate-disclosure/builder/start-wizard/views/step_4.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/wp-affiliate-disclosure/builder/start-wizard/views/step_5.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpadc() in wp-content/plugins/wp-affiliate-disclosure/builder/builder/controller.php:67
    • > PHP Warning
      Use of undefined constant WPADC_PATH - assumed 'WPADC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-affiliate-disclosure/includes/freemius.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/wp-affiliate-disclosure/builder/settings-page/views/form.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-affiliate-disclosure/builder/start-wizard/views/step_6.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-affiliate-disclosure/builder/start-wizard/views/step_3.php:13
    • > PHP Warning
      require_once(WPADC_PATH/freemius/start.php): failed to open stream: No such file or directory in wp-content/plugins/wp-affiliate-disclosure/includes/freemius.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpadc() in wp-content/plugins/wp-affiliate-disclosure/includes/help/free_version.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpadc() in wp-content/plugins/wp-affiliate-disclosure/builder/settings-page/controller.php:68

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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
10 plugin tags: disclosure statement, ftc, ftc disclosure statement, affiliate disclaimer statement, disclosure...

wp-affiliate-disclosure/functions.php 85% from 13 tests

"WP Affiliate Disclosure" version 1.2.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("/langCopyright 2012 - 2023 Smashing Advantage Enterprise.")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-affiliate-disclosure.php" instead of "functions.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected46,425 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PHP1468,80218,59136,370
CSS21121323,993
JavaScript117987423,133
SVG1002,671
PO File198133236
JSON10022

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity74.66
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes64
▷ Abstract classes23.12%
▷ Concrete classes6296.88%
▷ Final classes00.00%
Methods1,382
▷ Static methods20314.69%
▷ Public methods98271.06%
▷ Protected methods171.23%
▷ Private methods38327.71%
Functions119
▷ Named functions119100.00%
▷ Anonymous functions00.00%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wp-affiliate-disclosure.png7.48KB2.50KB▼ 66.61%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/img/logo.png7.48KB2.50KB▼ 66.61%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%