84% any-post-slider

Code Review | Any Post Slider

WordPress plugin Any Post Slider scored84%from 54 tests.

About plugin

  • Plugin page: any-post-slider
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 12, 2022
  • Latest release: Sep 6, 2023
  • Number of updates: 24
  • Update frequency: every 21.3 days
  • Top authors: itpathsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,553 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼4.21ms] Passed 4 tests

This is a short check of server-side resources used by Any Post Slider
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.53 ▲1.83
Dashboard /wp-admin3.41 ▲0.0747.50 ▼15.10
Posts /wp-admin/edit.php3.53 ▲0.1749.97 ▼1.33
Add New Post /wp-admin/post-new.php6.02 ▲0.1399.96 ▼2.24
Media Library /wp-admin/upload.php3.34 ▲0.1143.90 ▲6.78
All Sliders /wp-admin/edit.php?post_type=any_post_slider3.3839.17
Add New Slider /wp-admin/post-new.php?post_type=any_post_slider3.4244.03

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Any Post Slider
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,936 ▲17513.38 ▼0.9811.99 ▲10.1538.24 ▼0.80
Dashboard /wp-admin2,226 ▲515.58 ▼0.07113.74 ▲10.4142.47 ▲1.50
Posts /wp-admin/edit.php2,131 ▲312.05 ▲0.0640.03 ▼1.0335.24 ▼6.47
Add New Post /wp-admin/post-new.php1,553 ▲2723.42 ▲0.15676.81 ▼18.6563.64 ▲9.10
Media Library /wp-admin/upload.php1,431 ▲284.23 ▲0.04105.81 ▼4.0546.68 ▲0.54
All Sliders /wp-admin/edit.php?post_type=any_post_slider1,1031.9534.0831.74
Add New Slider /wp-admin/post-new.php?post_type=any_post_slider1,7402.5256.6167.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Any_Post_Slider' not found in wp-content/plugins/any-post-slider/public/partials/any-post-slider-public-display.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/any-post-slider/public/partials/any-post-slider-layout_three.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/any-post-slider/public/partials/any-post-slider-no_content.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/any-post-slider/public/partials/any-post-slider-layout_one.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/any-post-slider/public/partials/any-post-slider-layout_two.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/any-post-slider/public/partials/any-post-slider-layout_five.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Any_Post_Slider' not found in wp-content/plugins/any-post-slider/admin/partials/any-post-slider-cpt-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/any-post-slider/public/partials/any-post-slider-layout_four.php:6

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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: post grid, custom post type sliders, carousel, sliders, post sliders

any-post-slider/any-post-slider.php 92% from 13 tests

The principal PHP file in "Any Post Slider" v. 1.0.3 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,210 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP18179627721
CSS32615266
JavaScript42373164
SVG10159

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.34
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods3085.71%
▷ Protected methods00.00%
▷ Private methods514.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 1.39MB with 0.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/back.png4.79KB3.43KB▼ 28.38%
admin/images/slider_style4.png456.90KB153.81KB▼ 66.34%
public/images/place_holder.png13.91KB7.23KB▼ 48.04%
admin/images/slider_style3.png138.40KB151.58KB0.00%
admin/images/snowy-owl.png0.97KB0.83KB▼ 14.13%