89% slidenswap-gallery

Code Review | slidenswap

WordPress plugin slidenswap scored89%from 54 tests.

About plugin

  • Plugin page: slidenswap-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2014
  • Latest release: Apr 1, 2015
  • Number of updates: 13
  • Update frequency: every 11.8 days
  • Top authors: AZdv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /795 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by slidenswap
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.74 ▼1.54
Dashboard /wp-admin3.38 ▲0.0448.42 ▼8.97
Posts /wp-admin/edit.php3.50 ▲0.1451.85 ▲3.18
Add New Post /wp-admin/post-new.php5.96 ▲0.0880.23 ▼28.45
Media Library /wp-admin/upload.php3.28 ▲0.0637.31 ▲2.22

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: 1 new table, 7 new options
New tables
wp_slidenswap
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
slidenswap_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for slidenswap
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,067 ▲32115.39 ▲0.997.37 ▲5.6938.50 ▼1.56
Dashboard /wp-admin2,360 ▲1756.45 ▲0.66129.95 ▲29.2136.66 ▼6.70
Posts /wp-admin/edit.php2,275 ▲1863.38 ▲1.3753.71 ▲12.8535.53 ▼1.39
Add New Post /wp-admin/post-new.php1,540 ▲2618.46 ▲0.84597.76 ▼64.5033.34 ▼21.07
Media Library /wp-admin/upload.php1,408 ▲204.25 ▲0.0893.95 ▼20.0241.74 ▼7.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: image animation effect, slidenswap, image gallery

slidenswap-gallery/slidenswap.php 77% from 13 tests

The main PHP script in "slidenswap" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("slidenswap-gallery.php" instead of "slidenswap.php")
  • Domain Path: The domain path folder does not exist ("/lang/")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin441 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32441194
PHP23530186
CSS26160
Markdown1001

PHP code Passed 2 tests

Analyzing 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.21
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1173.33%
▷ Protected methods00.00%
▷ Private methods426.67%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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