84% gm-html-carousel

Code Review | GM HTML Carousel

WordPress plugin GM HTML Carousel scored84%from 54 tests.

About plugin

  • Plugin page: gm-html-carousel
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2017
  • Latest release: Oct 23, 2017
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: gabrielmioni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.76ms] Passed 4 tests

Server-side resources used by GM HTML Carousel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.20 ▼6.22
Dashboard /wp-admin3.31 ▲0.0049.97 ▼1.89
Posts /wp-admin/edit.php3.36 ▲0.0049.39 ▼1.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.02 ▼10.24
Media Library /wp-admin/upload.php3.23 ▲0.0033.16 ▼4.70

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for GM HTML Carousel
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.452.13 ▼0.0843.19 ▲0.75
Dashboard /wp-admin2,206 ▲155.92 ▲0.10100.20 ▼5.6540.70 ▼5.63
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0740.38 ▲3.6634.66 ▼2.22
Add New Post /wp-admin/post-new.php1,536 ▲1723.37 ▲0.27653.43 ▼2.7852.67 ▲1.45
Media Library /wp-admin/upload.php1,385 ▼64.20 ▼0.07100.55 ▲1.8949.48 ▲7.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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

SRP 50% 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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gm-html-carousel/gm_html_carousel.php:27

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: slider, carousel, jquery, testimonials, javascript...

gm-html-carousel/gm_html_carousel.php 92% from 13 tests

The main file in "GM HTML Carousel" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gm-html-carousel.php" instead of "gm_html_carousel.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected522 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
Markdown1750197
JavaScript3638155
PHP25019121
CSS113049

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.27
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods250.00%
▷ Protected methods250.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin