78% revenue-share-plugin-for-authorsrsp

Code Review | Revenue Share for Authors (RSP for Wordpress)

WordPress plugin Revenue Share for Authors (RSP for Wordpress) scored 78% from 54 tests.

About plugin

  • Plugin page: revenue-share-plu...
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2
  • WordPress version: 6.3.1
  • First release: Jan 25, 2013
  • Latest release: Jun 18, 2015
  • Number of updates: 33
  • Update frequency: every 26.5 days
  • Top authors: obscurant1st (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active / 4,591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.09MB] [CPU: ▲0.05ms] Passed 4 tests

Analyzing server-side resources used by Revenue Share for Authors (RSP for Wordpress)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1045.73 ▲3.52
Dashboard /wp-admin3.40 ▲0.0954.55 ▲4.46
Posts /wp-admin/edit.php3.52 ▲0.1648.22 ▼8.98
Add New Post /wp-admin/post-new.php5.99 ▲0.0998.39 ▲5.71
Media Library /wp-admin/upload.php3.33 ▲0.0940.20 ▲1.22
RSP Menu /wp-admin/options-general.php?page=RSP_plugin3.2733.79

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 10 new options
New WordPress options
widget_rspwidget
RSP_options[radio_option1]
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
RSP_options[RSP_text_string]
RSP_options[adshare_percentage]
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Revenue Share for Authors (RSP for Wordpress)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1513.21 ▼0.025.06 ▲3.4843.22 ▼0.95
Dashboard /wp-admin2,207 ▲14.84 ▼1.05107.03 ▼1.8041.86 ▼3.25
Posts /wp-admin/edit.php2,093 ▲12.05 ▲0.0637.51 ▼4.0733.27 ▼0.69
Add New Post /wp-admin/post-new.php1,536 ▼023.36 ▼0.02610.10 ▼75.4056.23 ▼3.26
Media Library /wp-admin/upload.php1,392 ▲14.21 ▲0.0396.37 ▼7.4841.94 ▼1.59
RSP Menu /wp-admin/options-general.php?page=RSP_plugin9812.0224.1734.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 10 options
    • can_compress_scripts
    • db_upgraded
    • widget_rspwidget
    • theysaidso_admin_options
    • RSP_options[radio_option1]
    • RSP_options[RSP_text_string]
    • widget_recent-posts
    • widget_theysaidso_widget
    • RSP_options[adshare_percentage]
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=RSP_plugin
    • > Notice in wp-content/plugins/revenue-share-plugin-for-authorsrsp/rShareAuthors.php+49
    Trying to access array offset on value of type bool

SRP 50% 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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/revenue-share-plugin-for-authorsrsp/widgetad.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/revenue-share-plugin-for-authorsrsp/rShareAuthors.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: There were no tags found
  • Contributors: Plugin contributors not specified
The official readme.txt might help

revenue-share-plugin-for-authorsrsp/rShareAuthors.php 92% from 13 tests

The main file in "Revenue Share for Authors (RSP for Wordpress)" v. 2.1.1 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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("revenue-share-plugin-for-authorsrsp.php" instead of "rShareAuthors.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected524 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2015456
CSS15068

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.22
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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