68% wp-mock-slider

Code Review | Wp Mock Slider

WordPress plugin Wp Mock Slider scored68%from 54 tests.

About plugin

  • Plugin page: wp-mock-slider
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.5.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2016
  • Latest release: Apr 27, 2016
  • Number of updates: 7
  • Update frequency: every 13.0 days
  • Top authors: muhammadumer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,956 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Wp Mock Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.394.97 ▼31.90
Dashboard /wp-admin2.10 ▼1.255.42 ▼52.89
Posts /wp-admin/edit.php2.10 ▼1.266.06 ▼46.45
Add New Post /wp-admin/post-new.php2.10 ▼3.796.54 ▼88.39
Media Library /wp-admin/upload.php2.10 ▼1.135.99 ▼30.34
WP Mock Slider /wp-admin/edit.php?post_type=slider-image2.105.48
Add New /wp-admin/post-new.php?post_type=slider-image2.106.72

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wp Mock Slider
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲21113.38 ▼0.999.32 ▲7.6335.16 ▼4.59
Dashboard /wp-admin2,241 ▲615.56 ▼0.0985.19 ▼6.7842.87 ▲3.83
Posts /wp-admin/edit.php2,149 ▲462.04 ▲0.0840.43 ▲4.3138.58 ▲3.02
Add New Post /wp-admin/post-new.php1,569 ▲4323.11 ▼0.05654.50 ▼15.7935.23 ▼24.84
Media Library /wp-admin/upload.php1,446 ▲434.28 ▲0.06105.42 ▼0.3747.29 ▲2.90
WP Mock Slider /wp-admin/edit.php?post_type=slider-image1,1101.9632.4031.07
Add New /wp-admin/post-new.php?post_type=slider-image1,7723.6261.6632.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-classie handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% 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)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-classie handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-modernizr handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-main handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-normalize_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-demo_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-animate_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mock-slider-mockup2_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+175
    Undefined index: large_heading
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+176
    Undefined index: slide_Description
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+177
    Undefined index: slide_link
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+178
    Undefined index: link_text
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+179
    Undefined index: link_target
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+201
    Trying to get property 'ID' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slider-image
    • > Notice in wp-content/plugins/wp-mock-slider/mock-slider.php+179
    Trying to access array offset on value of type null

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 fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-mock-slider/mock-slider.php:11
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-mock-slider/mock-slider.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 92 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-mock-slider/mock-slider.php 92% from 13 tests

The main file in "Wp Mock Slider" v. 1.0.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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-mock-slider.php" instead of "mock-slider.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin3,816 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS5543163,003
SVG200544
PHP15211140
JavaScript32734129

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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