68% fmtc-affiliate-disclosure

Code Review | FMTC Affiliate Disclosure

WordPress plugin FMTC Affiliate Disclosure scored68%from 54 tests.

About plugin

  • Plugin page: fmtc-affiliate-di...
  • Plugin version: 2.0.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9.2
  • WordPress version: 6.3.1
  • First release: Nov 30, 2016
  • Latest release: Mar 24, 2022
  • Number of updates: 8
  • Update frequency: every 241.6 days
  • Top authors: fmtc (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /18,016 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: ▼0.93MB] [CPU: ▼35.45ms] Passed 4 tests

Server-side resources used by FMTC Affiliate Disclosure
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0338.98 ▼2.44
Dashboard /wp-admin3.01 ▼0.2922.15 ▼29.36
Posts /wp-admin/edit.php3.01 ▼0.3422.78 ▼24.79
Add New Post /wp-admin/post-new.php3.01 ▼2.8723.39 ▼72.00
Media Library /wp-admin/upload.php3.01 ▼0.2121.37 ▼15.66
Affiliate Disclosure /wp-admin/options-general.php?page=fmtc-affiliate-disclosure3.0124.25

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
fmtc_affiliate_disclosure_text
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for FMTC Affiliate Disclosure
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.30 ▼1.081.68 ▼0.5341.76 ▼1.39
Dashboard /wp-admin2,210 ▲255.81 ▼0.10100.98 ▼0.8237.79 ▼8.28
Posts /wp-admin/edit.php2,096 ▲72.04 ▼0.0039.59 ▲4.5535.49 ▼0.10
Add New Post /wp-admin/post-new.php1,539 ▲1823.43 ▲0.23683.97 ▼3.1158.53 ▲2.86
Media Library /wp-admin/upload.php1,392 ▲14.28 ▲0.0894.38 ▼2.5243.39 ▼5.16
Affiliate Disclosure /wp-admin/options-general.php?page=fmtc-affiliate-disclosure8122.0522.4229.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=fmtc-affiliate-disclosure
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=fmtc-affiliate-disclosure
    • > Notice in wp-content/plugins/fmtc-affiliate-disclosure/fmtc-affiliate-disclosure.php+96
    Trying to access array offset on value of type null

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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/fmtc-affiliate-disclosure/fmtc-affiliate-disclosure.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

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
2 plugin tags: disclosure, affiliate

fmtc-affiliate-disclosure/fmtc-affiliate-disclosure.php Passed 13 tests

"FMTC Affiliate Disclosure" version 2.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
74 characters long description:
Add FTC-Compliant Disclosure statement to the beginning of your blog posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected79 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1232979

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/disclosure.png6.44KB3.34KB▼ 48.10%