72% gravitation-slider

Code Review | Gravitation Slider

WordPress plugin Gravitation Slider scored72%from 54 tests.

About plugin

  • Plugin page: gravitation-slider
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-4.7.2
  • WordPress version: 6.3.1
  • First release: May 21, 2016
  • Latest release: Jan 27, 2017
  • Number of updates: 7
  • Update frequency: every 80.6 days
  • Top authors: UlisesFreitas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,361 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.34MB] [CPU: ▼6.48ms] Passed 4 tests

A check of server-side resources used by Gravitation Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5142.70 ▲3.55
Dashboard /wp-admin3.84 ▲0.5351.53 ▲0.83
Posts /wp-admin/edit.php3.89 ▲0.5349.24 ▲1.77
Add New Post /wp-admin/post-new.php5.67 ▼0.2362.92 ▼29.77
Media Library /wp-admin/upload.php3.76 ▲0.5338.99 ▲1.24
Add New Slider /wp-admin/post-new.php?post_type=gv_slider3.6838.15
All sliders /wp-admin/edit.php?post_type=gv_slider3.7938.40

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Gravitation Slider
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,982 ▲23613.62 ▼1.149.79 ▲8.2943.59 ▲0.58
Dashboard /wp-admin2,195 ▲74.85 ▼0.01106.42 ▲3.9439.84 ▼1.60
Posts /wp-admin/edit.php2,050 ▼392.00 ▼0.0137.46 ▼1.3934.65 ▼0.79
Add New Post /wp-admin/post-new.php1,565 ▲4623.38 ▲0.27674.97 ▼24.1638.75 ▼15.68
Media Library /wp-admin/upload.php1,433 ▲454.21 ▼0.0197.22 ▼8.1342.52 ▼5.54
Add New Slider /wp-admin/post-new.php?post_type=gv_slider2,2635.0396.74104.44
All sliders /wp-admin/edit.php?post_type=gv_slider9291.9229.7626.02
Help /wp-admin/gravitation-slider.php260.440.0912.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=gv_slider
    • > User deprecated in wp-includes/functions.php+5828
    Hook dbx_post_advanced is deprecated since version 3.7.0! Use add_meta_boxes instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gv_slider
    • > Notice in wp-content/plugins/gravitation-slider/gravitation-slider.php+610
    Trying to get property 'ID' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/gravitation-slider/gravitation-slider.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gravitation-slider/custom-meta-boxes/custom-meta-boxes.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gravitation-slider/custom-meta-boxes/example-functions.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravitation-slider/custom-meta-boxes/classes.fields.php:633

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/gravitation-slider.php
    • > Network (severe)
    wp-admin/gravitation-slider.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (screenshot-1.png), #2 (screenshot-2.png)
Please take inspiration from this readme.txt

gravitation-slider/gravitation-slider.php Passed 13 tests

Analyzing the main PHP file in "Gravitation Slider" version 1.0.2
79 characters long description:
Gravitation Slider, is a plugin to display slider on your site, with shortcodes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin10,805 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript621,1228314,158
CSS193541593,229
PHP79844062,110
JSON800640
SVG200464
Markdown127072
PO File2162063
Bourne Shell124055
XML10014

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.92
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods113
▷ Static methods21.77%
▷ Public methods10794.69%
▷ Protected methods32.65%
▷ Private methods32.65%
Functions37
▷ Named functions3697.30%
▷ Anonymous functions12.70%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
24 PNG files occupy 0.54MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
custom-meta-boxes/images/cmb-icon-remove@2x.png1.14KB0.23KB▼ 79.47%
custom-meta-boxes/css/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
custom-meta-boxes/images/cmb-icon-remove.png1.00KB0.14KB▼ 85.64%
custom-meta-boxes/css/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%
custom-meta-boxes/css/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%