79% wp-sponsors

Code Review | Sponsors

WordPress plugin Sponsors scored79%from 54 tests.

About plugin

  • Plugin page: wp-sponsors
  • Plugin version: 3.5.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Dec 5, 2014
  • Latest release: May 15, 2021
  • Number of updates: 138
  • Update frequency: every 17.1 days
  • Top authors: janhenckens (86.96%)ibenic (13.77%)

Code review

54 tests

User reviews

8 reviews

Install metrics

3,000+ active /92,533 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼17.67ms] Passed 4 tests

This is a short check of server-side resources used by Sponsors
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3042.56 ▲3.05
Dashboard /wp-admin3.67 ▲0.3245.04 ▼19.60
Posts /wp-admin/edit.php3.72 ▲0.3644.18 ▼4.67
Add New Post /wp-admin/post-new.php5.21 ▼0.6850.88 ▼49.44
Media Library /wp-admin/upload.php3.53 ▲0.2940.13 ▲4.44
Documentation /wp-admin/edit.php?post_type=sponsors&page=wp-sponsors-docs3.5634.02
Add New /wp-admin/post-new.php?post_type=sponsors3.7453.76
All Sponsors /wp-admin/edit.php?post_type=sponsors3.5736.65
Categories /wp-admin/edit-tags.php?taxonomy=sponsor_categories&post_type=sponsors3.5233.18

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 60 new files
Database: no new tables, 8 new options
New WordPress options
widget_sponsors_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
sponsors_db_version
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Sponsors: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲20113.66 ▼0.726.30 ▲4.5344.74 ▲1.46
Dashboard /wp-admin2,245 ▲575.91 ▲1.0497.79 ▼21.3639.72 ▼2.52
Posts /wp-admin/edit.php2,128 ▲392.04 ▼0.0135.18 ▲1.0033.11 ▼3.51
Add New Post /wp-admin/post-new.php6,388 ▲4,86927.95 ▲4.45923.86 ▲276.1640.23 ▼10.42
Media Library /wp-admin/upload.php1,424 ▲364.21 ▼0.09123.81 ▲11.8347.54 ▼2.22
Documentation /wp-admin/edit.php?post_type=sponsors&page=wp-sponsors-docs1,4632.0723.5331.89
Add New /wp-admin/post-new.php?post_type=sponsors2,4187.66177.8265.99
All Sponsors /wp-admin/edit.php?post_type=sponsors1,1331.9430.7028.17
Categories /wp-admin/edit-tags.php?taxonomy=sponsor_categories&post_type=sponsors1,2982.1527.5227.84

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • sponsors_db_version
    • widget_recent-comments
    • widget_sponsors_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-sponsors/admin/partials/wp-sponsors-admin-display.php
    • > /wp-content/plugins/wp-sponsors/public/partials/wp-sponsors-public-display.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/wp-sponsors/admin/partials/documentation.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wp-sponsors/admin/partials/meta-boxes/sponsor-info.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-sponsors/includes/class-wp-sponsors-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-sponsors/admin/partials/meta-boxes/ss-info.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: images, post type, sponsors, partners

wp-sponsors/wp-sponsors.php Passed 13 tests

The main file in "Sponsors" v. 3.5.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
109 characters long description:
Add links and logo's for your sponsors/partners/etc to your sidebars and posts with our widget and shortcode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,739 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP213117691,649
JavaScript9477451
PO File3129141339
Sass4380295
CSS5005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.85
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods66
▷ Static methods1116.67%
▷ Public methods5583.33%
▷ Protected methods00.00%
▷ Private methods1116.67%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin