73% raptive-affiliate

Code Review | Raptive Affiliate

WordPress plugin Raptive Affiliate scored73%from 54 tests.

About plugin

  • Plugin page: raptive-affiliate
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: May 9, 2023
  • Latest release: Aug 15, 2023
  • Number of updates: 24
  • Update frequency: every 4.1 days
  • Top authors: hscafemedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /609 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.63ms] 75% from 4 tests

This is a short check of server-side resources used by Raptive Affiliate
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 4,241.95ms on /wp-admin/admin.php?page=recommend_links)
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.46 ▼1.83
Dashboard /wp-admin3.45 ▲0.1454.56 ▲0.82
Posts /wp-admin/edit.php3.56 ▲0.2047.99 ▼2.11
Add New Post /wp-admin/post-new.php6.05 ▲0.1686.75 ▼19.40
Media Library /wp-admin/upload.php3.37 ▲0.1439.15 ▲2.65
Import Links /wp-admin/admin.php?page=import_links3.3434.60
Recommendations /wp-admin/admin.php?page=recommend_links3.584,241.95
Last Action /wp-admin/admin.php?page=rapaf_rollback3.3436.38

Server storage [IO: ▲0.91MB] [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: 30 new files
Database: 1 new table, 6 new options
New tables
wp_termmeta_audit_trail
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Raptive Affiliate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲5013.74 ▼0.821.69 ▼0.2244.08 ▼0.90
Dashboard /wp-admin2,242 ▲625.46 ▼0.21119.15 ▲26.2239.26 ▼6.04
Posts /wp-admin/edit.php2,147 ▲502.73 ▲0.7349.38 ▲12.1636.54 ▲1.69
Add New Post /wp-admin/post-new.php1,567 ▲4123.66 ▲0.05677.52 ▲53.8736.75 ▼13.49
Media Library /wp-admin/upload.php1,447 ▲474.91 ▲0.70116.63 ▲6.0042.45 ▼1.18
Import Links /wp-admin/admin.php?page=import_links8482.4840.1128.29
Recommendations /wp-admin/admin.php?page=recommend_links8262.5441.0926.57
Last Action /wp-admin/admin.php?page=rapaf_rollback8322.3139.2126.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_termmeta_audit_trail
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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)
Even though everything seems fine, this is not an exhaustive test

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
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/raptive-affiliate/includes/admin/class-rapaf-link-inserter.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/raptive-affiliate/includes/admin/class-rapaf-import-links.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/raptive-affiliate/includes/admin/class-rapaf-admin-menu.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/raptive-affiliate/includes/admin/class-rapaf-rollback.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/raptive-affiliate/includes/admin/class-rapaf-recommend-links.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

raptive-affiliate/raptive-affiliate.php 92% from 13 tests

The principal PHP file in "Raptive Affiliate" v. 1.0.4 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Requires PHP: Required version must match the one declared in readme.txt ("5.4" instead of "5.6")

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
Success! There were no dangerous files found in this plugin10,545 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JSON3009,002
PHP123683561,271
CSS23212104
Sass113098
JavaScript6329170

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.40
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods66
▷ Static methods5989.39%
▷ Public methods6496.97%
▷ Protected methods00.00%
▷ Private methods23.03%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/imgur_yellow_warning.png4.46KB1.51KB▼ 66.10%
assets/icons/imgur_blue_info.png4.30KB1.51KB▼ 64.82%
assets/icon-128x128.png6.20KB1.65KB▼ 73.34%
assets/icons/imgur_red_alert.png4.24KB1.48KB▼ 65.18%
assets/icons/imgur_green_check.png4.34KB1.51KB▼ 65.32%