68% press-loft-affiliate-network

Code Review | Press Loft Affiliate Network

WordPress plugin Press Loft Affiliate Network scored68%from 54 tests.

About plugin

  • Plugin page: press-loft-affili...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 2, 2022
  • Latest release: Jul 13, 2023
  • Number of updates: 14
  • Update frequency: every 18.1 days
  • Top authors: grahamhouse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /602 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.31ms] Passed 4 tests

A check of server-side resources used by Press Loft Affiliate Network
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1337.27 ▼6.96
Dashboard /wp-admin3.42 ▲0.1244.85 ▼3.92
Posts /wp-admin/edit.php3.54 ▲0.1848.48 ▲1.93
Add New Post /wp-admin/post-new.php6.02 ▲0.1483.84 ▼8.30
Media Library /wp-admin/upload.php3.35 ▲0.1235.67 ▲3.11
Press Loft Affiliate Network /wp-admin/options-general.php?page=press-loft-affiliate-network3.3130.30

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: 1 new table, 7 new options
New tables
wp_press_loft_affiliate_network
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
pl_an_active
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Press Loft Affiliate Network
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15913.61 ▼1.037.92 ▲6.1440.84 ▼2.68
Dashboard /wp-admin2,214 ▲264.85 ▼1.04103.25 ▼5.5738.04 ▼2.33
Posts /wp-admin/edit.php2,100 ▲112.00 ▲0.0039.42 ▲0.3234.18 ▼0.38
Add New Post /wp-admin/post-new.php1,530 ▼318.30 ▼4.70598.16 ▼56.8356.58 ▼6.83
Media Library /wp-admin/upload.php1,399 ▲84.25 ▼0.0298.83 ▲0.3441.98 ▼1.65
Press Loft Affiliate Network /wp-admin/options-general.php?page=press-loft-affiliate-network7772.0224.7524.56

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_press_loft_affiliate_network
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/press-loft-affiliate-network/public/partials/press-loft-affiliate-network-public-display.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/press-loft-affiliate-network/admin/partials/press-loft-affiliate-network-admin-options-header.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/press-loft-affiliate-network/admin/partials/press-loft-affiliate-network-admin-options.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/press-loft-affiliate-network/admin/partials/press-loft-affiliate-network-admin-options-field-application-key.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/press-loft-affiliate-network/admin/partials/press-loft-affiliate-network-admin-woocommerce-not-installed.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/press-loft-affiliate-network/admin/partials/press-loft-affiliate-network-admin-options-field-affiliate-id.php:15

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === press-loft-affiliate-network === )
  • Contributors: Plugin contributors not specified
You can look at the official readme.txt

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

The entry point to "Press Loft Affiliate Network" version 1.0.5 is a PHP file that has certain tags in its header comment area
121 characters long description:
The Press Loft Affiliate Network plugin enables brands to track sales generated through the Press Loft affiliate network.

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
Good job! No executable or dangerous file extensions detected465 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP16292675450
CSS2379
JavaScript24456

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.14
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin