94% general-slider

Code Review | General Slider

WordPress plugin General Slider scored 94% from 54 tests.

About plugin

  • Plugin page: general-slider
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.7
  • WordPress version: 5.8.1
  • First release: Apr 6, 2021
  • Latest release: Apr 30, 2021
  • Number of updates: 19
  • Update frequency: every 1.3 days
  • Top authors: kstmonowar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 157 total downloads

Benchmarks

Plugin footprint Passed 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: ▲0.65MB] [CPU: ▼139.16ms] Passed 4 tests

An overview of server-side resources used by General Slider
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.18 ▲0.4634.65 ▲13.40
Dashboard /wp-admin3.77 ▲0.7253.13 ▲9.14
Posts /wp-admin/edit.php3.86 ▲0.7539.93 ▲1.73
Add New Post /wp-admin/post-new.php6.12 ▲0.6992.35 ▼569.67
Media Library /wp-admin/upload.php3.71 ▲0.7135.52 ▲2.15
Create New Slider /wp-admin/post-new.php?post_type=slider4.2154.01
View Sliders /wp-admin/edit.php?post_type=slider3.7635.26

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 381 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for General Slider
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,884 ▲28816.86 ▲1.3415.90 ▲6.4357.65 ▲9.99
Dashboard /wp-admin3,021 ▲876.16 ▲0.19136.35 ▼12.54113.13 ▼0.24
Posts /wp-admin/edit.php2,787 ▲482.74 ▲0.0264.61 ▲2.3893.37 ▲2.29
Add New Post /wp-admin/post-new.php1,651 ▼2522.54 ▲3.69263.88 ▼108.04107.91 ▼1.50
Media Library /wp-admin/upload.php1,852 ▲425.09 ▲0.05144.73 ▼10.10112.12 ▼10.33
Create New Slider /wp-admin/post-new.php?post_type=slider2,6624.6199.94118.84
View Sliders /wp-admin/edit.php?post_type=slider1,4562.6561.9673.11

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 successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 44× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/general-slider/inc/function.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/general-slider/inc/CMB2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: image slider, slider, general slider, wordpress slider, responsive slider

general-slider/general-slider.php 92% from 13 tests

The main PHP script in "General Slider" version 1.0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.9" instead of "5.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected52,225 lines of code in 229 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP642,2926,4997,551
CSS172901,2114,803
JavaScript108511,5563,470
SVG1002,671
Sass17305291,407

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity18.51
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes70
▷ Abstract classes912.86%
▷ Concrete classes6187.14%
▷ Final classes11.64%
Methods544
▷ Static methods8916.36%
▷ Public methods45283.09%
▷ Protected methods8916.36%
▷ Private methods30.55%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants327.27%
▷ Class constants872.73%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/CMB2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
inc/CMB2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
inc/CMB2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
inc/CMB2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
inc/CMB2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%