68% prime-affiliate-links

Code Review | Prime Affiliate Links - Super-Powered Affiliate Links Manager

WordPress plugin Prime Affiliate Links - Super-Powered Affiliate Links Manager scored68%from 54 tests.

About plugin

  • Plugin page: prime-affiliate-l...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.0
  • WordPress version: 6.3.1
  • First release: Sep 25, 2022
  • Latest release: Sep 25, 2022
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: monowp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /783 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲4.51MB] [CPU: ▲15.28ms] Passed 4 tests

A check of server-side resources used by Prime Affiliate Links - Super-Powered Affiliate Links Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.22 ▲4.7659.33 ▲19.06
Dashboard /wp-admin8.24 ▲4.9468.15 ▲24.07
Posts /wp-admin/edit.php8.24 ▲4.8978.63 ▲29.49
Add New Post /wp-admin/post-new.php9.33 ▲3.44116.28 ▼11.52
Media Library /wp-admin/upload.php8.24 ▲5.0165.77 ▲32.32
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius8.2455.93

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 287 new files
Database: no new tables, 18 new options
New WordPress options
fs_accounts
prime_affiliate_links_uncloak
widget_recent-comments
widget_theysaidso_widget
prime_affiliate_links_is_custom_link_prefix
prime_affiliate_links_link_prefix
widget_recent-posts
fs_debug_mode
fs_active_plugins
fs_gdpr
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Prime Affiliate Links - Super-Powered Affiliate Links Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9514.82 ▲0.391.57 ▼0.2229.84 ▼9.18
Dashboard /wp-admin2,242 ▲545.06 ▼0.04102.19 ▼12.5342.17 ▼3.38
Posts /wp-admin/edit.php2,125 ▲302.01 ▲0.0140.06 ▼1.4039.46 ▲4.57
Add New Post /wp-admin/post-new.php1,543 ▲2924.47 ▲6.84638.35 ▼1.7054.31 ▼10.03
Media Library /wp-admin/upload.php1,421 ▲304.13 ▼0.08101.82 ▲1.9943.15 ▼0.91
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius1,0811.6926.3130.86

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/prime-affiliate-links/includes/freemius/includes/class-freemius.php+8619
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 18 options in the database
    • widget_recent-comments
    • prime_affiliate_links_redirection_type
    • widget_theysaidso_widget
    • prime_affiliate_links_is_custom_link_prefix
    • fs_debug_mode
    • fs_active_plugins
    • prime_affiliate_links_forward_parameters
    • db_upgraded
    • fs_accounts
    • prime_affiliate_links_uncloak
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/prime-affiliate-links/Views/pages/guide.php
    • > /wp-content/plugins/prime-affiliate-links/Views/widgets/sponsors.php
    • > /wp-content/plugins/prime-affiliate-links/Views/widgets/sponsors-form.php
    • > /wp-content/plugins/prime-affiliate-links/prime-affiliate-links.php
    • > /wp-content/plugins/prime-affiliate-links/Views/settings/tools.php
  • 45× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mono_WP\\Prime_Affiliate_Links\\Models\\BaseModel' not found in wp-content/plugins/prime-affiliate-links/Models/Post.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mono_WP\\Prime_Affiliate_Links\\Providers\\Base_Service_Provider' not found in wp-content/plugins/prime-affiliate-links/Providers/Settings_Service_Provider.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mono_WP\\Prime_Affiliate_Links\\Models\\BaseModel' not found in wp-content/plugins/prime-affiliate-links/Models/Click.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/prime-affiliate-links/Views/settings/redirection_type.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/prime-affiliate-links/Views/metaboxes/link_settings.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mono_WP\\Prime_Affiliate_Links\\Providers\\Base_Service_Provider' not found in wp-content/plugins/prime-affiliate-links/Providers/CPT_Service_Provider.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/prime-affiliate-links/Views/settings/forward_parameters.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/prime-affiliate-links/Views/metaboxes/submitdiv.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Mono_WP\\Prime_Affiliate_Links\\Controllers\\Base_Controller' not found in wp-content/plugins/prime-affiliate-links/Controllers/Settings_Controller.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'TypistTech\\Imposter\\ConfigInterface' not found in wp-content/plugins/prime-affiliate-links/vendor/typisttech/imposter/src/Config.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 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
5 plugin tags: link branding, link tracking, links, affiliate, shortlinks

prime-affiliate-links/prime-affiliate-links.php 85% from 13 tests

"Prime Affiliate Links - Super-Powered Affiliate Links Manager" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path should use only dashes and lowercase characters ("/Languages/")
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin35,254 lines of code in 213 files:
LanguageFilesBlank linesComment linesLines of code
PHP1837,96717,20333,482
SVG202627
Markdown21870378
JavaScript870114348
JSON400340
CSS1412679

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity47.30
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces10
Interfaces6
Traits0
Classes85
▷ Abstract classes33.53%
▷ Concrete classes8296.47%
▷ Final classes00.00%
Methods1,328
▷ Static methods21215.96%
▷ Public methods96772.82%
▷ Protected methods181.36%
▷ Private methods34325.83%
Functions112
▷ Named functions10190.18%
▷ Anonymous functions119.82%
Constants125
▷ Global constants9979.20%
▷ Class constants2620.80%
▷ Public constants2596.15%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.35MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Assets/images/upgrade.png200.88KB66.14KB▼ 67.08%
includes/freemius/includes/freemius-pricing/5480ed23b199531a8cbc05924f26952b.png7.09KB2.94KB▼ 58.58%
includes/freemius/assets/img/super-affiliate-links.png9.16KB5.26KB▼ 42.58%
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/freemius/includes/freemius-pricing/f3aac72a8e63997d6bb888f816457e9b.png5.90KB3.16KB▼ 46.47%