78% swiper-js-slider

Code Review | Swiper Js Slider

WordPress plugin Swiper Js Slider scored78%from 54 tests.

About plugin

  • Plugin page: swiper-js-slider
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.3
  • WordPress version: 6.3.1
  • First release: Sep 2, 2019
  • Latest release: Nov 28, 2019
  • Number of updates: 9
  • Update frequency: every 9.7 days
  • Top authors: mfarazaly (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /7,016 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.93ms] Passed 4 tests

A check of server-side resources used by Swiper Js Slider
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.23 ▲2.05
Dashboard /wp-admin3.36 ▲0.0553.16 ▲0.14
Posts /wp-admin/edit.php3.48 ▲0.1252.46 ▲7.24
Add New Post /wp-admin/post-new.php6.00 ▲0.1284.90 ▼15.71
Media Library /wp-admin/upload.php3.26 ▲0.0336.31 ▼14.18
All Items /wp-admin/edit.php?post_type=swiper_js_slides3.3343.08
Add New /wp-admin/post-new.php?post_type=swiper_js_slides3.3949.74

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Swiper Js Slider
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,087 ▲34115.68 ▲1.388.38 ▲6.5645.91 ▲1.14
Dashboard /wp-admin2,362 ▲1746.41 ▲0.55129.61 ▲13.4992.98 ▲46.83
Posts /wp-admin/edit.php2,286 ▲2003.37 ▲1.3751.15 ▲14.9368.08 ▲32.06
Add New Post /wp-admin/post-new.php1,544 ▲2517.53 ▼5.62669.97 ▲37.6037.49 ▼13.53
Media Library /wp-admin/upload.php1,416 ▲284.12 ▼0.0981.85 ▼28.3189.07 ▲41.22
All Items /wp-admin/edit.php?post_type=swiper_js_slides1,2743.3146.2064.41
Add New /wp-admin/post-new.php?post_type=swiper_js_slides2,7884.0078.74122.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/swiper-js-slider/swiper-js-slider.php
    • > /wp-content/plugins/swiper-js-slider/index.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swiper-js-slider/views/metabox/pagination-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/swiper-js-slider/views/meta-box-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swiper-js-slider/views/metabox/breakpoints-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swiper-js-slider/views/metabox/navigation-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/swiper-js-slider/inc/post-types.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/swiper-js-slider/views/metabox/carousel-meta.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swiper-js-slider/views/metabox/parameters-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/swiper-js-slider/views/front-columns.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/swiper-js-slider/shortcode/slide-js-shortcode.php:178
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swiper-js-slider/views/metabox/autoplay-meta.php:3

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 Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: swiper, carousel, multirow, image slider, js slider...

swiper-js-slider/swiper-js-slider.php 85% from 13 tests

"Swiper Js Slider" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.2.4" instead of "7.3")
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.1" instead of "5.3")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,762 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP13111661,212
CSS36811345
JavaScript34815205

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo.png0.39KB0.39KB0.00%