64% simple-sponsorships

Code Review | Simple Sponsorships

WordPress plugin Simple Sponsorships scored64%from 54 tests.

About plugin

  • Plugin page: simple-sponsorships
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9.3
  • WordPress version: 6.3.1
  • First release: Jan 24, 2019
  • Latest release: Apr 17, 2022
  • Number of updates: 44
  • Update frequency: every 26.8 days
  • Top authors: ibenic (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /4,136 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.26MB] [CPU: ▲28.73ms] 75% from 4 tests

A check of server-side resources used by Simple Sponsorships
Please have a look at the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.26MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.84 ▲5.3775.01 ▲33.35
Dashboard /wp-admin8.86 ▲5.5583.30 ▲37.81
Posts /wp-admin/edit.php8.92 ▲5.5680.44 ▲32.45
Add New Post /wp-admin/post-new.php10.43 ▲4.5496.93 ▲11.31
Media Library /wp-admin/upload.php8.86 ▲5.6276.90 ▲41.71
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.9464.40

Server storage [IO: ▲5.25MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 350 new files
Database: 8 new tables, 15 new options
New tables
wp_ss_sponsorship_itemmeta
wp_ss_sponsorships
wp_ss_packages
wp_ss_packagemeta
wp_ss_sponsorshipmeta
wp_ss_reportmeta
wp_ss_sponsorship_items
wp_ss_reports
New WordPress options
widget_theysaidso_widget
fs_debug_mode
widget_recent-comments
ss_version
widget_ss_widget_sponsors
theysaidso_admin_options
ss_settings
ss_use_php_sessions
db_upgraded
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by Simple Sponsorships
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.54 ▼0.899.33 ▲7.3732.15 ▼17.24
Dashboard /wp-admin2,242 ▲575.85 ▼0.0098.90 ▼21.2039.28 ▼3.87
Posts /wp-admin/edit.php2,125 ▲362.00 ▼0.0039.70 ▲2.1835.08 ▲0.19
Add New Post /wp-admin/post-new.php6,404 ▲4,87124.03 ▲0.99930.32 ▲295.1158.93 ▲10.23
Media Library /wp-admin/upload.php1,424 ▲364.25 ▲0.06107.82 ▲8.6446.97 ▲3.70
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0711.6929.5428.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/simple-sponsorships/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie tables detected upon uninstall: 8 tables
    • wp_ss_sponsorship_itemmeta
    • wp_ss_packages
    • wp_ss_sponsorshipmeta
    • wp_ss_packagemeta
    • wp_ss_reportmeta
    • wp_ss_reports
    • wp_ss_sponsorships
    • wp_ss_sponsorship_items
  • This plugin did not uninstall successfully, leaving 15 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_ss_widget_placeholder
    • widget_recent-comments
    • db_upgraded
    • widget_ss_widget_sponsors
    • fs_accounts
    • ss_version
    • can_compress_scripts
    • ss_use_php_sessions
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 72× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-sponsorships/includes/widgets/class-widget-placeholder.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Sponsorships\\DB\\DB' not found in wp-content/plugins/simple-sponsorships/includes/db/class-db-sponsors.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/simple-sponsorships/templates/shortcode/sponsors.php:26
    • > PHP Fatal error
      Uncaught Error: Call to a member function is_request() on null in wp-content/plugins/simple-sponsorships/templates/sponsorship/details.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Sponsorships\\Form_Payment' not found in wp-content/plugins/simple-sponsorships/templates/sponsorship/customer-details.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Simple_Sponsorships\\Admin\\add_action() in wp-content/plugins/simple-sponsorships/includes/admin/class-reports.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/simple-sponsorships/includes/admin/views/packages/list.php:1
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/simple-sponsorships/templates/account/sponsorships.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/simple-sponsorships/includes/admin/views/packages/edit.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/simple-sponsorships/includes/admin/views/sponsorships/edit.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: podcasts, sponsors, payment, events, sponsorships

simple-sponsorships/simple-sponsorships.php Passed 13 tests

The primary PHP file in "Simple Sponsorships" version 1.8.1 is used by WordPress to initiate all plugin functionality
46 characters long description:
Accept sponsors and sponsorships on your site.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected57,340 lines of code in 300 files:
LanguageFilesBlank linesComment linesLines of code
PHP2249,51420,54440,154
JavaScript293,3142,77216,410
Sass191091675
CSS184855
SVG100246

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity46.02
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes110
▷ Abstract classes109.09%
▷ Concrete classes10090.91%
▷ Final classes11.00%
Methods1,603
▷ Static methods21213.23%
▷ Public methods1,23577.04%
▷ Protected methods422.62%
▷ Private methods32620.34%
Functions196
▷ Named functions196100.00%
▷ Anonymous functions00.00%
Constants130
▷ Global constants10580.77%
▷ Class constants2519.23%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%