78% ppm-carousel

Code Review | PPM Carousel

WordPress plugin PPM Carousel scored 78% from 53 tests.

About plugin

  • Plugin page: ppm-carousel
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 5.8.1
  • First release: May 22, 2013
  • Latest release: Jul 16, 2013
  • Number of updates: 9
  • Update frequency: every 6.1 days
  • Top authors: perfectpointmarketing (100%)

Code review

53 tests

User reviews

16 reviews

Install metrics

300+ active / 18,788 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.86MB] [CPU: ▼367.40ms] Passed 4 tests

An overview of server-side resources used by PPM Carousel
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.77 ▼1.065.97 ▼24.56
Dashboard /wp-admin1.79 ▼1.266.02 ▼32.00
Posts /wp-admin/edit.php1.79 ▼1.316.29 ▼39.71
Add New Post /wp-admin/post-new.php1.79 ▼3.645.29 ▼1,362.94
Media Library /wp-admin/upload.php1.79 ▼1.215.48 ▼34.93
Carousel Images /wp-admin/edit.php?post_type=carousel-image1.795.16
Add New /wp-admin/post-new.php?post_type=carousel-image1.795.97

Server storage [IO: ▲0.21MB] [DB: ▲1.00MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for PPM Carousel
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲18416.38 ▲0.9712.18 ▲2.4245.63 ▲2.76
Dashboard /wp-admin2,950 ▲1006.09 ▲0.25136.82 ▲3.66118.03 ▲9.96
Posts /wp-admin/edit.php2,744 ▲412.73 ▲0.0565.88 ▼0.6588.98 ▲9.49
Add New Post /wp-admin/post-new.php1,882 ▲2919.19 ▲0.18381.35 ▲14.23104.71 ▼5.29
Media Library /wp-admin/upload.php1,757 ▼305.02 ▼0.00157.97 ▲16.87107.07 ▼0.37
Carousel Images /wp-admin/edit.php?post_type=carousel-image1,4042.6466.3871.64
Add New /wp-admin/post-new.php?post_type=carousel-image2,1874.53115.0575.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5663
    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 ppm-carousel-plugin-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=carousel-image
    • > User notice in wp-includes/functions.php+5663
    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 ppm-carousel-plugin-script 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=carousel-image
    • > User notice in wp-includes/functions.php+5663
    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 ppm-carousel-plugin-script-active 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=carousel-image
    • > User notice in wp-includes/functions.php+5663
    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 ppm-carousel-plugin-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/ppm-carousel/plugin-hook.php:13
    • > 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/ppm-carousel/plugin-hook.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ppm-carousel/carousel-img-type.php:31

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

readme.txt 88% 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 have no corresponding images in /assets: #1 (PPM Carousel in a post), #2 (PPM Carousel with large Image)
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

ppm-carousel/plugin-hook.php 92% from 13 tests

This is the main PHP file of "PPM Carousel" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ppm-carousel.php" instead of "plugin-hook.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin140 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP2233087
JavaScript4113752
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.04
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/nav_tablet.png1.28KB0.36KB▼ 72.13%
js/carousel.png1.10KB0.24KB▼ 78.04%
css/images/nav.png0.64KB0.45KB▼ 29.70%
css/images/nav_mobile.png1.17KB0.25KB▼ 78.85%