94% sponsors-carousel

Code Review | Sponsors Carousel

WordPress plugin Sponsors Carousel scored 94% from 54 tests.

About plugin

  • Plugin page: sponsors-carousel
  • Plugin version: 4.02
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0.3
  • WordPress version: 5.8.1
  • First release: Dec 20, 2011
  • Latest release: Feb 11, 2019
  • Number of updates: 43
  • Update frequency: every 60.7 days
  • Top authors: Nitay (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active / 40,619 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼166.71ms] Passed 4 tests

Analyzing server-side resources used by Sponsors Carousel
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.1041.81 ▲5.45
Dashboard /wp-admin3.17 ▲0.1153.26 ▲16.16
Posts /wp-admin/edit.php3.22 ▲0.1142.19 ▼7.39
Add New Post /wp-admin/post-new.php5.52 ▲0.0896.80 ▼669.58
Media Library /wp-admin/upload.php3.11 ▲0.1037.21 ▲4.68

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Sponsors Carousel
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,848 ▲25216.37 ▲0.3712.92 ▲2.8452.31 ▲2.87
Dashboard /wp-admin2,997 ▲636.09 ▲0.14146.15 ▼12.47122.71 ▼1.95
Posts /wp-admin/edit.php2,769 ▲302.70 ▼0.1271.52 ▲3.6799.01 ▼0.16
Add New Post /wp-admin/post-new.php1,516 ▼16716.77 ▼1.59365.04 ▼30.10134.18 ▲23.25
Media Library /wp-admin/upload.php1,837 ▲305.01 ▼0.00151.33 ▼22.10128.35 ▲3.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sponsors-carousel/sponsors-carousel.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (This shows the default look of the carousel.), #2 (This shows admin panel.)
The official readme.txt is a good inspiration

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

"Sponsors Carousel" version 4.02's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
38 characters long description:
Sponsors logos on javascript carousel.

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
Everything looks great! No dangerous files found in this plugin2,278 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript7319291,430
PHP25148506
PO File28892229
CSS240113

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions650.00%
▷ Anonymous functions650.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.25MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png44.67KB16.39KB▼ 63.30%
screenshot-2.png126.71KB43.86KB▼ 65.39%
screenshot-3.png81.88KB31.93KB▼ 61.01%