84% oc-image-slider

Code Review | OC Image Slider

WordPress plugin OC Image Slider scored84%from 54 tests.

About plugin

  • Plugin page: oc-image-slider
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 6, 2022
  • Latest release: Aug 6, 2022
  • Number of updates: 8
  • Update frequency: every 0.4 days
  • Top authors: toshioc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /955 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
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼0.52ms] Passed 4 tests

A check of server-side resources used by OC Image Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.33 ▼2.15
Dashboard /wp-admin3.38 ▲0.0849.01 ▼7.85
Posts /wp-admin/edit.php3.43 ▲0.0848.87 ▲0.28
Add New Post /wp-admin/post-new.php5.93 ▲0.0496.74 ▲8.50
Media Library /wp-admin/upload.php3.30 ▲0.0740.93 ▲7.65

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

OC Image Slider: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.81 ▼0.4615.47 ▲13.7253.32 ▲9.90
Dashboard /wp-admin2,195 ▲185.56 ▼0.0390.96 ▼2.7540.49 ▲1.71
Posts /wp-admin/edit.php2,102 ▲22.00 ▲0.0637.01 ▲0.6340.07 ▲9.22
Add New Post /wp-admin/post-new.php6,372 ▲4,84629.39 ▲6.37934.09 ▲334.4763.97 ▲8.93
Media Library /wp-admin/upload.php1,400 ▲34.23 ▲0.0799.00 ▲0.1044.20 ▼0.12

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/oc-image-slider/index.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 require attention:
  • Screenshots: Screenshot #7 (Turning changing image) image required
Please take inspiration from this readme.txt

oc-image-slider/index.php 92% from 13 tests

Analyzing the main PHP file in "OC Image Slider" version 0.1.1
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oc-image-slider.php" instead of "index.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
There were no executable files found in this plugin949 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JSON430583
PHP8110152321
CSS24231
JavaScript411414

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.25
▷ Minimum class complexity2.00
▷ Maximum class complexity11.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions225.00%
▷ Anonymous functions675.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin