10% cnhk-slideshow

Code Review | Cnhk Slideshow [ENDED]

WordPress plugin Cnhk Slideshow [ENDED] scored10%from 54 tests.

About plugin

  • Plugin page: cnhk-slideshow
  • Plugin version: 3.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.5
  • WordPress version: 6.3.1
  • First release: Nov 11, 2012
  • Latest release: Jun 12, 2016
  • Number of updates: 42
  • Update frequency: every 39.1 days
  • Top authors: cnhk_systems (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

90+ active /17,280 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/cnhk-slideshow/includes/class-slider-widget.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; CNHK_SLIDER_WIDGET has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼59.49ms] Passed 4 tests

This is a short check of server-side resources used by Cnhk Slideshow [ENDED]
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.85 ▼32.56
Dashboard /wp-admin2.10 ▼1.246.48 ▼55.75
Posts /wp-admin/edit.php2.10 ▼1.256.12 ▼38.99
Add New Post /wp-admin/post-new.php2.10 ▼3.785.65 ▼109.12
Media Library /wp-admin/upload.php2.10 ▼1.134.74 ▼34.11
Settings /wp-admin/edit.php?post_type=cnhkss&page=settings2.105.91
Effect Builder /wp-admin/edit.php?post_type=cnhkss&page=fx-builder2.106.15
Sliders /wp-admin/edit.php?post_type=cnhkss2.105.88
New Slider /wp-admin/post-new.php?post_type=cnhkss2.106.66

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 231 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_cnhk-slideshow

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cnhk Slideshow [ENDED]
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,952 ▲20613.55 ▼0.989.54 ▲7.8741.75 ▲4.07
Dashboard /wp-admin2,262 ▲845.70 ▲0.03106.41 ▲8.0141.00 ▼3.06
Posts /wp-admin/edit.php2,176 ▲762.13 ▲0.1245.73 ▲11.8035.61 ▼0.64
Add New Post /wp-admin/post-new.php1,583 ▲5723.51 ▼0.08641.61 ▼44.0134.07 ▼37.68
Media Library /wp-admin/upload.php1,473 ▲704.33 ▲0.10107.78 ▲3.6342.05 ▼4.35
Settings /wp-admin/edit.php?post_type=cnhkss&page=settings9721.9433.6124.25
Effect Builder /wp-admin/edit.php?post_type=cnhkss&page=fx-builder10,2622.5667.6246.12
Sliders /wp-admin/edit.php?post_type=cnhkss1,1662.0740.3528.95
New Slider /wp-admin/post-new.php?post_type=cnhkss1,9264.5889.0439.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/cnhk-slideshow/includes/class-slider-widget.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; CNHK_SLIDER_WIDGET has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_cnhk-slideshow
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=cnhkss
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/cnhk-slideshow/includes/class-slider-widget.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; CNHK_SLIDER_WIDGET has a deprecated constructor

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/cnhk-slideshow/admin/views/builder-template.php
    • > /wp-content/plugins/cnhk-slideshow/admin/views/slides-no-captions.php
    • > /wp-content/plugins/cnhk-slideshow/admin/views/slides-with-captions.php
  • 62× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cnhk-slideshow/modules/slide-html/views/layers-params.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'cnhk_db' not found in wp-content/plugins/cnhk-slideshow/admin/views/settings-general.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cnhk-slideshow/modules/caption/includes/caption-editor-markup.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'cnhk_nav_abstract' not found in wp-content/plugins/cnhk-slideshow/modules/nav-arrows/includes/class-nav-arrows.php:5
    • > PHP Notice
      Undefined variable: slide_id in wp-content/plugins/cnhk-slideshow/modules/slide-youtube/views/admin-params.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/cnhk-slideshow/modules/slide-vimeo/views/admin-params.php:10
    • > PHP Notice
      Undefined variable: slide_id in wp-content/plugins/cnhk-slideshow/modules/slide-youtube/views/admin-params.php on line 6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cnhk-slideshow/modules/caption/includes/admin-params.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'cnhk_ss' not found in wp-content/plugins/cnhk-slideshow/modules/nav-arrows/includes/admin-params.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'cnhk_template_abstract' not found in wp-content/plugins/cnhk-slideshow/modules/template-advanced/includes/class-template-advanced.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

cnhk-slideshow/cnhk-slideshow.php 92% from 13 tests

This is the main PHP file of "Cnhk Slideshow [ENDED]" version 3.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 plugin25,264 lines of code in 197 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript821,9091,67711,946
PHP896231,1077,944
CSS182361163,330
PO File16158441,387
SVG100640
HTML11012
JSON5005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity18.57
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes310.71%
▷ Concrete classes2589.29%
▷ Final classes00.00%
Methods218
▷ Static methods4420.18%
▷ Public methods17680.73%
▷ Protected methods125.50%
▷ Private methods3013.76%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/jQuery-UI-css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
lib/jQuery-UI-css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
lib/jQuery-UI-css/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
lib/jQuery-UI-css/images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%
lib/jQuery-UI-css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%