84% modern-slider

Code Review | Modern Slider

WordPress plugin Modern Slider scored84%from 54 tests.

About plugin

  • Plugin page: modern-slider
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.6
  • WordPress version: 6.3.1
  • First release: Jun 7, 2018
  • Latest release: Jun 8, 2018
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: pushlabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /797 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 gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.52ms] Passed 4 tests

Analyzing server-side resources used by Modern Slider
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.08 ▼5.89
Dashboard /wp-admin3.43 ▲0.1349.01 ▼5.80
Posts /wp-admin/edit.php3.48 ▲0.1247.43 ▼0.40
Add New Post /wp-admin/post-new.php5.96 ▲0.0888.42 ▼1.98
Media Library /wp-admin/upload.php3.33 ▲0.1138.78 ▲4.37

Server storage [IO: ▲3.49MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 399 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Modern Slider: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲12914.00 ▼0.5311.66 ▲9.3246.62 ▲2.98
Dashboard /wp-admin2,210 ▲425.66 ▲0.0984.10 ▼18.6639.95 ▼3.56
Posts /wp-admin/edit.php2,115 ▲182.06 ▲0.0934.50 ▼3.2733.94 ▼3.99
Add New Post /wp-admin/post-new.php1,537 ▲923.66 ▲0.58633.44 ▼48.8543.70 ▼9.75
Media Library /wp-admin/upload.php1,418 ▲184.27 ▲0.11105.19 ▲1.9444.53 ▼3.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 56× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/modern-slider/inc/vendor/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/modern-slider/inc/vendor/cmb2/includes/helper-functions.php:127
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/modern-slider/inc/vendor/cmb2/includes/CMB2_hookup.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Place the slider anywhere.), #2 (Specify where you would like your slider using the container (a selector).)
The official readme.txt might help

modern-slider/modern-slider.php Passed 13 tests

"Modern Slider" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
49 characters long description:
A modern slider for WordPress. Place it anywhere.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected56,974 lines of code in 249 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP713,0646,34711,265
CSS151,1611,1494,800
XML2004,498
JavaScript113744731,629
Sass16300251,374
Markdown62570770
Bourne Shell46745206
JSON20075
diff216834

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity16.08
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes87
▷ Abstract classes1112.64%
▷ Concrete classes7687.36%
▷ Final classes00.00%
Methods848
▷ Static methods11914.03%
▷ Public methods71784.55%
▷ Protected methods12815.09%
▷ Private methods30.35%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants956.25%
▷ Class constants743.75%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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/vendor/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
inc/vendor/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
inc/vendor/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
inc/vendor/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
inc/vendor/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%