78% lgx-owl-carousel

Code Review | OWL Carousel - WordPress Owl Carousel Slider

WordPress plugin OWL Carousel - WordPress Owl Carousel Slider scored78%from 54 tests.

About plugin

  • Plugin page: lgx-owl-carousel
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.0
  • WordPress version: 6.3.1
  • First release: May 5, 2016
  • Latest release: May 26, 2022
  • Number of updates: 65
  • Update frequency: every 34.0 days
  • Top authors: LogicHunt (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

4,000+ active /60,926 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▼1.12ms] 75% from 4 tests

A check of server-side resources used by OWL Carousel - WordPress Owl Carousel Slider
Please have a look at the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 4,424.15ms on /wp-admin/edit.php?post_type=lgxcarousel&page=lgxcarouselsettings)
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3442.19 ▲0.97
Dashboard /wp-admin3.81 ▲0.5053.24 ▼0.41
Posts /wp-admin/edit.php3.86 ▲0.5058.89 ▲9.95
Add New Post /wp-admin/post-new.php6.32 ▲0.4388.43 ▼13.16
Media Library /wp-admin/upload.php3.65 ▲0.4144.57 ▲8.11
Categories /wp-admin/edit-tags.php?taxonomy=lgxcarouselcat&post_type=lgxcarousel3.6742.60
Carousel Settings /wp-admin/edit.php?post_type=lgxcarousel&page=lgxcarouselsettings5.164,424.15
All Items /wp-admin/edit.php?post_type=lgxcarousel3.7848.19
Add New /wp-admin/post-new.php?post_type=lgxcarousel3.8352.34

Server storage [IO: ▲0.36MB] [DB: ▲0.17MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 45 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
lgxowl_config
widget_lgx_owl_widget
can_compress_scripts
widget_theysaidso_widget
db_upgraded
lgxowl_responsive
theysaidso_admin_options
lgxowl_basic
widget_recent-posts
...

Browser metrics Passed 4 tests

Checking browser requirements for OWL Carousel - WordPress Owl Carousel Slider
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,092 ▲32115.80 ▲1.595.78 ▲3.7739.26 ▼4.85
Dashboard /wp-admin2,386 ▲1956.67 ▲0.79124.51 ▲17.4597.88 ▲54.08
Posts /wp-admin/edit.php2,310 ▲2183.53 ▲1.5256.19 ▲18.1979.38 ▲48.32
Add New Post /wp-admin/post-new.php1,721 ▲20722.62 ▲5.14626.15 ▲5.5231.21 ▼18.03
Media Library /wp-admin/upload.php1,440 ▲584.36 ▲0.1197.46 ▼14.9386.42 ▲41.35
Categories /wp-admin/edit-tags.php?taxonomy=lgxcarouselcat&post_type=lgxcarousel1,4773.3044.4173.56
Carousel Settings /wp-admin/edit.php?post_type=lgxcarousel&page=lgxcarouselsettings2,1553.7570.6672.68
All Items /wp-admin/edit.php?post_type=lgxcarousel1,2943.5046.9262.80
Add New /wp-admin/post-new.php?post_type=lgxcarousel2,3647.87171.28122.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_lgx_owl_widget
    • lgxowl_basic
    • widget_recent-comments
    • lgxowl_config
    • lgxowl_style
    • lgxowl_responsive
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/lgx-owl-carousel/public/partials/lgx-owl-carousel-public-display.php
    • > /wp-content/plugins/lgx-owl-carousel/admin/partials/lgx-owl-carousel-admin-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/lgx-owl-carousel/widgets/lgx-owl-carousel-widget.php:16

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

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

lgx-owl-carousel/lgx-owl-carousel.php Passed 13 tests

The main PHP file in "OWL Carousel - WordPress Owl Carousel Slider" ver. 1.4.0 adds more information about the plugin and also serves as the entry point for this plugin
100 characters long description:
This is a Owl Carousel 2.0 based plugin for wordpress, a responsive and fully customizable carousel.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin6,863 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
CSS6536503,162
JavaScript54829491,851
PHP165528471,428
LESS812026422

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.11
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods69
▷ Static methods34.35%
▷ Public methods6492.75%
▷ Protected methods00.00%
▷ Private methods57.25%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/img/arrow-left.png1.40KB0.75KB▼ 46.65%
public/assets/lib/owl.carousel2/owl.video.play.png4.86KB2.74KB▼ 43.61%
admin/assets/img/owl-logo.png0.79KB0.84KB0.00%
public/assets/img/arrow-right.png1.37KB0.75KB▼ 45.42%