87% wp-swiper-slider

Code Review | WP Swiper

WordPress plugin WP Swiper scored 87% from 54 tests.

About plugin

  • Plugin page: wp-swiper-slider
  • Plugin version: 0.1.6.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.2
  • WordPress version: 5.8.1
  • First release: Apr 29, 2016
  • Latest release: Jan 27, 2019
  • Number of updates: 53
  • Update frequency: every 18.9 days
  • Top authors: webevasion (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active / 9,168 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼173.74ms] Passed 4 tests

Server-side resources used by WP Swiper
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.1434.43 ▲6.84
Dashboard /wp-admin3.50 ▲0.4357.64 ▲7.50
Posts /wp-admin/edit.php3.54 ▲0.4256.18 ▲19.10
Add New Post /wp-admin/post-new.php5.78 ▲0.3485.44 ▼716.08
Media Library /wp-admin/upload.php3.36 ▲0.3532.77 ▲6.80
All sliders /wp-admin/edit.php?post_type=wp_swiper3.4840.09
Add New /wp-admin/post-new.php?post_type=wp_swiper3.5254.98

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 286 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Swiper
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,063 ▲46217.66 ▲1.699.61 ▲3.4372.23 ▼4.60
Dashboard /wp-admin3,164 ▲2688.00 ▲1.82140.01 ▲9.52164.75 ▼9.89
Posts /wp-admin/edit.php3,014 ▲2715.23 ▲2.01114.40 ▲48.36135.10 ▼8.48
Add New Post /wp-admin/post-new.php2,351 ▼1,38516.09 ▼2.50370.34 ▼105.96159.89 ▼3.14
Media Library /wp-admin/upload.php1,803 ▲485.63 ▲0.14125.12 ▼24.29186.30 ▲4.75
All sliders /wp-admin/edit.php?post_type=wp_swiper1,6855.3787.29117.41
Add New /wp-admin/post-new.php?post_type=wp_swiper2,7396.10133.47195.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/templates/upload.php
    • > /wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/templates/media.php
    • > /wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/templates/image-advanced.php
  • 58× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/url.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Multiple_Values_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/text-list.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Choice_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/input-list.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Walker' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/walkers/select-walker.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/multiple-values.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/wysiwyg.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/hidden.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-swiper-slider/wp_swiper_admin_functions.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/map.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/wp-swiper-slider/assets/metabox_helper/inc/fields/datetime.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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 require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-swiper-slider === )
  • Screenshots: These screenshots need descriptions #1, #2 in wp-swiper-slider/assets to your readme.txt
You can take inspiration from this readme.txt

wp-swiper-slider/wp_swiper.php 92% from 13 tests

The principal PHP file in "WP Swiper" v. 0.1.6.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-swiper-slider.php" instead of "wp_swiper.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin8,625 lines of code in 253 files:
LanguageFilesBlank linesComment linesLines of code
PHP696122,3823,900
JavaScript1523374733,213
CSS321171141,512

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.02
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes711.11%
▷ Concrete classes5688.89%
▷ Final classes00.00%
Methods269
▷ Static methods23185.87%
▷ Public methods269100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
15 PNG files occupy 0.77MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/metabox_helper/img/jqueryui/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
assets/metabox_helper/img/jqueryui/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
assets/screenshot-2.png349.32KB99.72KB▼ 71.45%
assets/metabox_helper/img/jqueryui/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
assets/metabox_helper/img/jqueryui/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%