84% category-post-slider

Code Review | Category Post Slider

WordPress plugin Category Post Slider scored84%from 54 tests.

About plugin

  • Plugin page: category-post-slider
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: May 10, 2016
  • Latest release: Jul 26, 2022
  • Number of updates: 95
  • Update frequency: every 23.9 days
  • Top authors: gbsdeveloper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼4.07ms] Passed 4 tests

An overview of server-side resources used by Category Post Slider
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1643.91 ▲2.59
Dashboard /wp-admin3.49 ▲0.1549.72 ▼15.17
Posts /wp-admin/edit.php3.61 ▲0.2554.33 ▲4.88
Add New Post /wp-admin/post-new.php6.08 ▲0.1986.96 ▼1.15
Media Library /wp-admin/upload.php3.42 ▲0.1935.09 ▼2.56
Category Post Slider /wp-admin/options-general.php?page=category-post-slider3.3932.69

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
category_post_slider_option_name
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Category Post Slider
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲15913.84 ▼0.339.08 ▲7.4744.91 ▼1.08
Dashboard /wp-admin2,204 ▲325.66 ▼0.0688.41 ▼12.9540.10 ▼1.55
Posts /wp-admin/edit.php2,106 ▲272.00 ▲0.0135.85 ▼1.5532.54 ▼1.00
Add New Post /wp-admin/post-new.php1,531 ▼523.59 ▲5.57595.89 ▼42.0154.39 ▼5.67
Media Library /wp-admin/upload.php1,403 ▲34.21 ▼0.05100.26 ▼6.0343.49 ▼2.80
Category Post Slider /wp-admin/options-general.php?page=category-post-slider1,2981.6723.5831.23

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • category_post_slider_option_name
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however 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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/category-post-slider/cps-setting-option.php:680
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/category-post-slider/category-post-slider.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: images, category, post slider, slider, image slider

category-post-slider/category-post-slider.php Passed 13 tests

The primary PHP file in "Category Post Slider" version 1.3 is used by WordPress to initiate all plugin functionality
32 characters long description:
A WordPress Category Post Slider

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,243 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript127111,102
PHP212828741
CSS13225400

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity142.00
▷ Minimum class complexity142.00
▷ Maximum class complexity142.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods38100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/controls.png2.19KB0.95KB▼ 56.49%