84% badgeos-affiliatewp

Code Review | BadgeOS AffiliateWP Integration

WordPress plugin BadgeOS AffiliateWP Integration scored84%from 54 tests.

About plugin

  • Plugin page: badgeos-affiliatewp
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 18, 2020
  • Latest release: Aug 19, 2020
  • Number of updates: 3
  • Update frequency: every 2.7 days
  • Top authors: learningtimes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /481 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.15ms] Passed 4 tests

An overview of server-side resources used by BadgeOS AffiliateWP Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.89 ▲0.80
Dashboard /wp-admin3.31 ▲0.0048.01 ▼4.64
Posts /wp-admin/edit.php3.36 ▲0.0049.64 ▲2.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.67 ▼12.33
Media Library /wp-admin/upload.php3.23 ▲0.0038.65 ▼0.42

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

BadgeOS AffiliateWP Integration: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7413.35 ▼1.044.64 ▲2.7540.77 ▼4.84
Dashboard /wp-admin2,221 ▲154.87 ▼0.0399.30 ▼5.9837.78 ▼9.24
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0240.31 ▲2.6236.28 ▲1.98
Add New Post /wp-admin/post-new.php1,545 ▼023.36 ▲0.12674.83 ▲28.5262.17 ▲13.30
Media Library /wp-admin/upload.php1,403 ▲64.19 ▼0.01107.12 ▲5.0444.28 ▼1.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/badgeos-affiliatewp/includes/badgeos/steps-ui.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos-affiliatewp/includes/badgeos/rules-engine.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: engagement, award, badge, openbadges, affiliatewp...

badgeos-affiliatewp/badgeos-affiliatewp.php 92% from 13 tests

The main file in "BadgeOS AffiliateWP Integration" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.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
Good job! No executable or dangerous file extensions detected504 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5212342504

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.50
▷ Minimum class complexity5.00
▷ Maximum class complexity18.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods440.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
No PNG files were detected