78% sponsor-redirect

Code Review | Sponsor Redirect

WordPress plugin Sponsor Redirect scored78%from 54 tests.

About plugin

  • Plugin page: sponsor-redirect
  • Plugin version: 0.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 14, 2016
  • Latest release: Jan 14, 2016
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: shahalom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,314 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲1.40ms] Passed 4 tests

Server-side resources used by Sponsor Redirect
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0847.05 ▲2.52
Dashboard /wp-admin3.38 ▲0.0756.10 ▲2.70
Posts /wp-admin/edit.php3.41 ▲0.0676.99 ▲8.18
Add New Post /wp-admin/post-new.php5.96 ▲0.07107.70 ▼6.95
Media Library /wp-admin/upload.php3.30 ▲0.0746.78 ▲7.32
Documentation /wp-admin/edit.php?post_type=sponsor&page=msbd-srp-documentation3.2738.82
Settings /wp-admin/edit.php?post_type=sponsor&page=msbd-srp-settings3.2739.54
Add New /wp-admin/post-new.php?post_type=sponsor3.4161.26
Sponsors /wp-admin/edit.php?post_type=sponsor3.3348.60

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Sponsor Redirect
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10113.25 ▼1.054.22 ▲2.4945.32 ▼14.03
Dashboard /wp-admin2,258 ▲555.03 ▼0.86102.09 ▼4.4544.49 ▲7.09
Posts /wp-admin/edit.php2,137 ▲342.19 ▲0.1742.57 ▼1.9933.48 ▼4.35
Add New Post /wp-admin/post-new.php1,571 ▲4523.27 ▲5.85617.52 ▼54.9868.17 ▲9.42
Media Library /wp-admin/upload.php1,437 ▲374.15 ▼0.11115.33 ▼0.5546.35 ▼3.17
Documentation /wp-admin/edit.php?post_type=sponsor&page=msbd-srp-documentation1,1415.17148.7856.72
Settings /wp-admin/edit.php?post_type=sponsor&page=msbd-srp-settings1,0834.83152.3433.19
Add New /wp-admin/post-new.php?post_type=sponsor2,2827.65170.3265.10
Sponsors /wp-admin/edit.php?post_type=sponsor1,1092.0033.8433.27

Uninstaller [IO: ▲0.00MB] [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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • _msbd_srp_options
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/sponsor-redirect/main.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=sponsor&page=msbd-srp-settings
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Optimizations

Plugin configuration 90% 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
7 plugin tags: show sponsor image, affiliate url redirect, manage affiliate partners, manage sponsor links, sponsor redirect...

sponsor-redirect/main.php 77% from 13 tests

"Sponsor Redirect" version 0.0.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sponsor-redirect.php" instead of "main.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 208 characters long)

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
Success! There were no dangerous files found in this plugin847 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6299148744
CSS217079
JavaScript26924

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity16.25
▷ Minimum class complexity4.00
▷ Maximum class complexity27.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods721.88%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/msbd_favicon_16.png0.61KB0.63KB0.00%
images/msbd_favicon_32.png1.12KB1.20KB0.00%
images/msbd_logo.png28.81KB9.10KB▼ 68.41%