84% swiftpic

Code Review | SwiftPic

WordPress plugin SwiftPic scored84%from 54 tests.

About plugin

  • Plugin page: swiftpic
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.0.0
  • WordPress version: 6.3.1
  • First release: Jun 13, 2022
  • Latest release: Jun 13, 2022
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: sharespring (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /467 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.14ms] Passed 4 tests

Server-side resources used by SwiftPic
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.11 ▼1.35
Dashboard /wp-admin3.34 ▲0.0348.50 ▼3.98
Posts /wp-admin/edit.php3.39 ▲0.0350.00 ▼1.82
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.54 ▼4.09
Media Library /wp-admin/upload.php3.26 ▲0.0334.49 ▼2.65
SwiftPic /wp-admin/options-general.php?page=swiftpic3.2232.44

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

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

Browser metrics Passed 4 tests

Checking browser requirements for SwiftPic
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.24 ▼0.132.51 ▲0.7645.17 ▼0.36
Dashboard /wp-admin2,199 ▲225.62 ▼0.0591.12 ▼3.9238.95 ▼4.90
Posts /wp-admin/edit.php2,107 ▲102.04 ▲0.0238.49 ▼0.8035.32 ▲0.59
Add New Post /wp-admin/post-new.php1,531 ▼623.38 ▲4.90643.99 ▲3.2351.51 ▼3.67
Media Library /wp-admin/upload.php1,404 ▲104.27 ▲0.12111.08 ▲8.5945.02 ▼2.07
SwiftPic /wp-admin/options-general.php?page=swiftpic8342.0325.4129.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/swiftpic/_inc/settings.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/swiftpic/_inc/settings.php:21

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

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: scale, resize, image

swiftpic/swiftpic.php Passed 13 tests

The primary PHP file in "SwiftPic" version 1.0.0 is used by WordPress to initiate all plugin functionality
71 characters long description:
Helper functions for image resizing in theme development using SwiftPic

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
Good job! No executable or dangerous file extensions detected147 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33061140
JSON1007

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
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
No PNG files were detected