90% affiliates-buddypress

Code Review | Affiliates BuddyPress

WordPress plugin Affiliates BuddyPress scored90%from 54 tests.

About plugin

  • Plugin page: affiliates-buddyp...
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 8, 2016
  • Latest release: May 17, 2022
  • Number of updates: 16
  • Update frequency: every 131.9 days
  • Top authors: itthinx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /4,962 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.97ms] Passed 4 tests

This is a short check of server-side resources used by Affiliates BuddyPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0342.34 ▲4.07
Dashboard /wp-admin3.34 ▼0.0151.70 ▼11.63
Posts /wp-admin/edit.php3.39 ▲0.0344.82 ▼6.56
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.09 ▼19.18
Media Library /wp-admin/upload.php3.26 ▲0.0337.71 ▼2.52

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

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

Browser metrics Passed 4 tests

Affiliates BuddyPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.72 ▲0.452.17 ▲0.4042.43 ▼4.25
Dashboard /wp-admin2,203 ▲295.63 ▼0.0891.98 ▼9.4944.32 ▼2.60
Posts /wp-admin/edit.php2,108 ▲81.97 ▼0.0635.70 ▼4.8034.80 ▼1.13
Add New Post /wp-admin/post-new.php1,537 ▲223.26 ▲4.91683.11 ▼10.2360.17 ▼10.61
Media Library /wp-admin/upload.php1,411 ▲144.11 ▼0.06112.52 ▲5.7546.98 ▼2.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Overview - shows the new Affiliates tab added on the BuddyPress user profile page.), #2 (Submenu - the BuddyPress submenu item.), #3 (Settings - where plugin options are maintained)
You can take inspiration from this readme.txt

affiliates-buddypress/affiliates-buddypress.php Passed 13 tests

The principal PHP file in "Affiliates BuddyPress" v. 1.3.0 is loaded by WordPress automatically on each request
111 characters long description:
Affiliates integration with BuddyPress that allows to display affiliate content in the BuddyPress user profile.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected326 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP249104243
PO File16215480
CSS1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity13.00
▷ Minimum class complexity5.00
▷ Maximum class complexity21.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods12100.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.17MB with 0.13MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png58.99KB16.07KB▼ 72.76%
screenshot-2.png22.26KB5.66KB▼ 74.57%
screenshot-1.png95.97KB28.91KB▼ 69.88%