67% wp-sponsorship

Code Review | WPSponsorship

WordPress plugin WPSponsorship scored67%from 54 tests.

About plugin

  • Plugin page: wp-sponsorship
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 27, 2015
  • Latest release: Aug 2, 2015
  • Number of updates: 27
  • Update frequency: every 0.4 days
  • Top authors: xbenx (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,179 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.59MB] [CPU: ▼6.38ms] Passed 4 tests

A check of server-side resources used by WPSponsorship
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5031.40 ▼9.78
Dashboard /wp-admin3.93 ▲0.6247.31 ▼4.64
Posts /wp-admin/edit.php3.96 ▲0.6047.16 ▲3.97
Add New Post /wp-admin/post-new.php6.64 ▲0.7575.25 ▼15.06
Media Library /wp-admin/upload.php3.87 ▲0.6337.97 ▲3.98
Mail Format /wp-admin/admin.php?page=admin_page4.2738.98
Extensions /wp-admin/admin.php?page=extensions_page3.7234.47
Mail Settings /wp-admin/admin.php?page=port_settings4.2434.32

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 571 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPSponsorship
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲21613.62 ▼0.826.48 ▲4.4345.94 ▲0.24
Dashboard /wp-admin2,244 ▲595.88 ▲0.0496.82 ▼10.7439.02 ▼2.50
Posts /wp-admin/edit.php2,127 ▲382.02 ▼0.0139.84 ▲4.5534.82 ▲1.86
Add New Post /wp-admin/post-new.php1,552 ▲1818.60 ▼4.64620.98 ▼54.5952.97 ▼1.37
Media Library /wp-admin/upload.php1,426 ▲384.22 ▲0.0496.62 ▼2.1341.54 ▼4.57
Mail Format /wp-admin/admin.php?page=admin_page2,1187.49172.4073.39
Extensions /wp-admin/admin.php?page=extensions_page8111.8727.8031.82
Mail Settings /wp-admin/admin.php?page=port_settings9581.7425.7530.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-sponsorship/public/partials/sponsorship-public-display.php
    • > /wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php
    • > /wp-content/plugins/wp-sponsorship/admin/partials/sponsorship-admin-display.php
  • 281× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'swift_required.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SwiftMailerTestCase' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-sponsorship/includes/class-sponsorship-admin_page.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Transport_Esmtp_Authenticator' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'SwiftMailerSmokeTestCase' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_InputByteStream' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Events_SendListener' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Please fix this invalid URI: "#"
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-sponsorship === )
  • Requires at least: Invalid version format
  • Tags: Please delete some tags, you are using 43 tag instead of maximum 10
The official readme.txt might help

wp-sponsorship/sponsorship.php 85% from 13 tests

Analyzing the main PHP file in "WPSponsorship" version 1.0.1
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-sponsorship.php" instead of "sponsorship.php")
  • 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 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt
      • wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt
      • wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt
      • wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt
      • wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt
      • wp-content/plugins/wp-sponsorship/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt
109,499 lines of code in 489 files:
LanguageFilesBlank linesComment linesLines of code
XML32047,776
PHP3416,89913,60432,930
PO File968,95411,87720,532
CSS61,0291,0303,970
reStructuredText111,0019291,374
Sass11168231,116
JavaScript7199195852
Markdown41560427
JSON500253
YAML3130173
Bourne Shell229796

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity7.08
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces1
Interfaces48
Traits0
Classes273
▷ Abstract classes103.66%
▷ Concrete classes26396.34%
▷ Final classes00.00%
Methods2,575
▷ Static methods642.49%
▷ Public methods2,16984.23%
▷ Protected methods1847.15%
▷ Private methods2228.62%
Functions165
▷ Named functions3823.03%
▷ Anonymous functions12776.97%
Constants50
▷ Global constants612.00%
▷ Class constants4488.00%
▷ Public constants44100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/webdevstudios/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
vendor/webdevstudios/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
vendor/webdevstudios/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png3.12KB2.17KB▼ 30.31%
vendor/webdevstudios/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%