10% content-grid-slider

Code Review | Content Grid Slider

WordPress plugin Content Grid Slider scored10%from 54 tests.

About plugin

  • Plugin page: content-grid-slider
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0
  • WordPress version: 6.3.1
  • First release: Apr 25, 2014
  • Latest release: Sep 12, 2014
  • Number of updates: 21
  • Update frequency: every 6.7 days
  • Top authors: councilsoft (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

100+ active /11,900 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ContentGridSlider::cgs_install() should not be called statically

Server metrics [RAM: ▼0.61MB] [CPU: ▼27.03ms] Passed 4 tests

This is a short check of server-side resources used by Content Grid Slider
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1243.11 ▼4.12
Dashboard /wp-admin3.44 ▲0.1358.12 ▲4.29
Posts /wp-admin/edit.php3.26 ▼0.1031.74 ▼22.96
Add New Post /wp-admin/post-new.php3.30 ▼2.5939.35 ▼75.05
Media Library /wp-admin/upload.php3.36 ▲0.1238.13 ▼5.97
Groups /wp-admin/edit-tags.php?taxonomy=cgs_groups&post_type=content-slider3.3539.55
Settings /wp-admin/edit.php?post_type=content-slider&page=content-slider-settings3.3036.51
Add New Slide /wp-admin/post-new.php?post_type=content-slider3.3034.76
All Grid Slides /wp-admin/edit.php?post_type=content-slider3.2632.47

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Content Grid Slider: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲15713.98 ▼0.389.78 ▲8.0345.78 ▲5.89
Dashboard /wp-admin2,238 ▲645.84 ▲0.1985.48 ▼10.0637.92 ▼6.46
Posts /wp-admin/edit.php2,160 ▲632.39 ▲0.4035.47 ▼0.5742.21 ▲8.85
Add New Post /wp-admin/post-new.php1,572 ▲4618.44 ▲0.96629.02 ▼79.9462.60 ▲5.44
Media Library /wp-admin/upload.php1,446 ▲434.33 ▲0.10103.29 ▼10.0644.79 ▼0.91
Groups /wp-admin/edit-tags.php?taxonomy=cgs_groups&post_type=content-slider1,3302.0935.0031.07
Settings /wp-admin/edit.php?post_type=content-slider&page=content-slider-settings1,1241.9837.2855.89
Add New Slide /wp-admin/post-new.php?post_type=content-slider2,4607.95172.0166.92
All Grid Slides /wp-admin/edit.php?post_type=content-slider1,1722.3232.9929.90

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
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=content-slider&page=content-slider-settings
    • > Notice in wp-content/plugins/content-grid-slider/content-grid-slider.php+185
    Undefined index: tab
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/content-grid-slider.php+132
    Undefined index: cgs_groups
    • > GET request to /wp-admin/edit.php?post_type=content-slider&page=content-slider-settings
    • > Notice in wp-content/plugins/content-grid-slider/actions/content-slider-custom-shortcodes.php+45
    Trying to get property 'count' of non-object
    • > GET request to /wp-admin/edit.php?post_type=content-slider&page=content-slider-settings
    • > Notice in wp-content/plugins/content-grid-slider/actions/content-slider-custom-shortcodes.php+115
    Undefined variable: id_suf_l
    • > GET request to /wp-admin/post-new.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php+2
    Undefined index: post_type
    • > GET request to /wp-admin/post-new.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php+10
    Undefined index: content_slider_url_page
    • > GET request to /wp-admin/post-new.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php+12
    Undefined index: content_slider_url_post
    • > GET request to /wp-admin/post-new.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php+14
    Undefined index: content_slider_url_custom
    • > GET request to /wp-admin/post-new.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php+17
    Undefined index: content_slider_url_target
    • > GET request to /wp-admin/edit.php?post_type=content-slider
    • > Notice in wp-content/plugins/content-grid-slider/content-grid-slider.php+110
    Undefined variable: args

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 items
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function query_posts() in wp-content/plugins/content-grid-slider/actions/content-slider-custom-shortcodes.php:23
    • > PHP Notice
      Undefined index: post_type in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php on line 2
    • > PHP Notice
      Undefined variable: orderby in wp-content/plugins/content-grid-slider/actions/content-slider-custom-shortcodes.php on line 6
    • > PHP Notice
      Undefined variable: groups in wp-content/plugins/content-grid-slider/actions/content-slider-custom-shortcodes.php on line 12
    • > PHP Notice
      Undefined index: taxonomy in wp-content/plugins/content-grid-slider/actions/remove-parent-category-links.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/content-grid-slider/content-grid-slider.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_meta_box() in wp-content/plugins/content-grid-slider/actions/add-page-url-custom-metabox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/content-grid-slider/actions/display-page-url-custom-metabox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/content-grid-slider/actions/content-slider-custom-posts.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/content-grid-slider/actions/save-page-url-custom-metabox.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

content-grid-slider/content-grid-slider.php 85% from 13 tests

"Content Grid Slider" version 1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 155 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("3.5" instead of "3.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin8,182 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,5721,6166,915
PHP127493765
CSS262477
HTML10025

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods415.38%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
12 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/twitter.png1.80KB0.66KB▼ 63.31%
images/googleplus_h.png1.86KB0.65KB▼ 64.84%
images/linkedin.png1.67KB0.62KB▼ 62.82%
images/pinterest.png1.94KB0.71KB▼ 63.65%
images/googleplus.png1.82KB0.65KB▼ 64.20%