67% smartframe

Code Review | WordPress Image Security and Compression Plugin - SmartFrame

WordPress plugin WordPress Image Security and Compression Plugin - SmartFrame scored 67% from 54 tests.

About plugin

  • Plugin page: smartframe
  • Plugin version: 2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.8
  • WordPress version: 5.9.2
  • First release: Jan 30, 2019
  • Latest release: Sep 7, 2021
  • Number of updates: 27
  • Update frequency: every 35.5 days
  • Top authors: smartframe (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 4,539 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲1.10MB] [CPU: ▲405.69ms] 50% from 4 tests

Server-side resources used by WordPress Image Security and Compression Plugin - SmartFrame
Please fix the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 906.07ms on /wp-admin/admin.php?page=smart-frame-tutorial)
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 405.69ms on /wp-admin/admin.php?page=smart-frame-tutorial)
PageMemory (MB)CPU Time (ms)
Home /5.00 ▲1.48317.73 ▲266.87
Dashboard /wp-admin6.00 ▲2.59935.35 ▲900.97
Posts /wp-admin/edit.php6.06 ▲2.41920.04 ▲877.44
Add New Post /wp-admin/post-new.php4.89 ▼2.08861.24 ▼422.52
Media Library /wp-admin/upload.php6.01 ▲2.71952.58 ▲929.04
Examples /wp-admin/admin.php?page=smart-frame-examples5.98907.56
Account /wp-admin/admin.php?page=smart-frame-register6.00968.23
Settings /wp-admin/admin.php?page=smart-frame-main-menu5.98985.43
Help /wp-admin/admin.php?page=smart-frame-tutorial5.98906.07

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 289 new files
Database: 1 new table, 5 new options
New tables
wp_smartframe_image
New WordPress options
smartframe-migration-3
smartframe-migration-2
sfm_smartframeWpPluginApiKey
smartframe-migration-1
smartframe-migration-4

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress Image Security and Compression Plugin - SmartFrame
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,991 ▲23716.16 ▲0.5310.04 ▲3.442.78 ▲0.37
Dashboard /wp-admin2,964 ▲1036.72 ▲0.54130.49 ▼6.40171.35 ▲7.19
Posts /wp-admin/edit.php2,759 ▲683.32 ▲0.0868.63 ▼0.45126.20 ▼24.44
Add New Post /wp-admin/post-new.php1,668 ▲718.88 ▲2.65362.72 ▼46.84186.94 ▲28.98
Media Library /wp-admin/upload.php1,771 ▲765.85 ▲0.30133.56 ▼14.32182.77 ▼4.17
Examples /wp-admin/admin.php?page=smart-frame-examples3,6056.40596.41215.85
Account /wp-admin/admin.php?page=smart-frame-register1,2502.9668.4692.59
Settings /wp-admin/admin.php?page=smart-frame-main-menu1,3292.9663.97125.21
Help /wp-admin/admin.php?page=smart-frame-tutorial1,2082.6863.57125.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_smartframe_image
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • smartframe-migration-4
    • smartframe-migration-3
    • sfm_smartframeWpPluginApiKey
    • smartframe-migration-1
    • smartframe-migration-2

Smoke tests 50% from 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smartframe/admin/partials/notifications/activate-api-key.php
    • > /wp-content/plugins/smartframe/admin/partials/footer.php
    • > /wp-content/plugins/smartframe/admin/partials/parts/header.php
    • > /wp-content/plugins/smartframe/admin/partials/inputs/smartframe-frame.php
  • 87× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\RuleValueList' not found in wp-content/plugins/smartframe/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcRuleValueList.php:5
    • > PHP Notice
      Undefined variable: imageId in wp-content/plugins/smartframe/admin/partials/inputs/smartframe-frame.php on line 1
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/smartframe/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSList' not found in wp-content/plugins/smartframe/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/smartframe/vendor/guzzlehttp/psr7/src/NoSeekStream.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/smartframe/vendor/guzzlehttp/psr7/src/Response.php:10
    • > PHP Warning
      Use of undefined constant SMARTFRAME_PLUGIN_URL - assumed 'SMARTFRAME_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/smartframe/admin/partials/parts/header.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/smartframe/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/smartframe/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/smartframe/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 89 tag instead of maximum 10
Please take inspiration from this readme.txt

smartframe/smartframe.php 77% from 13 tests

"WordPress Image Security and Compression Plugin - SmartFrame" version 2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path must begin with a forward slash character ("/")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Domain Path: The domain path should use only dashes and lowercase characters ("")

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
Everything looks great! No dangerous files found in this plugin30,527 lines of code in 263 files:
LanguageFilesBlank linesComment linesLines of code
PHP2143,1376,10015,455
JSON12007,670
Markdown131,17603,903
JavaScript124393402,240
CSS4291771,115
Sass311172
YAML25035
XML24028
make1409

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity11.20
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces48
Interfaces22
Traits2
Classes156
▷ Abstract classes95.77%
▷ Concrete classes14794.23%
▷ Final classes85.44%
Methods1,293
▷ Static methods1259.67%
▷ Public methods1,13187.47%
▷ Protected methods110.85%
▷ Private methods15111.68%
Functions173
▷ Named functions6034.68%
▷ Anonymous functions11365.32%
Constants109
▷ Global constants32.75%
▷ Class constants10697.25%
▷ Public constants106100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.34MB with 0.24MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/logo_transparentbackground_white.png342.43KB3.17KB▼ 99.08%
admin/img/wp_icon@2x.png2.41KB1.20KB▼ 50.16%
admin/img/wp_icon.png1.96KB0.73KB▼ 63.02%