10% shrinktheweb-website-preview-plugin

Code Review | ShrinkTheWeb (STW) Website Previews Plugin

WordPress plugin ShrinkTheWeb (STW) Website Previews Plugin scored10%from 54 tests.

About plugin

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /18,781 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_formbuilder.inc.php+74
    Methods with the same name as their class will not be constructors in a future version of PHP; FormBuilder has a deprecated constructor

Server metrics [RAM: ▼1.49MB] [CPU: ▼55.70ms] Passed 4 tests

This is a short check of server-side resources used by ShrinkTheWeb (STW) Website Previews Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.51 ▼0.966.82 ▼32.91
Dashboard /wp-admin2.53 ▼0.828.47 ▼45.89
Posts /wp-admin/edit.php2.53 ▼0.837.96 ▼39.18
Add New Post /wp-admin/post-new.php2.53 ▼3.367.18 ▼104.82
Media Library /wp-admin/upload.php2.53 ▼0.709.00 ▼25.02
How to use /wp-admin/admin.php?page=stwwt_documentation2.536.82
Shrink The Web /wp-admin/admin.php?page=stwwt_menu_main2.538.43
Thumbnail Cache /wp-admin/admin.php?page=stwwt_thumb_cache2.537.28
Error Logs /wp-admin/admin.php?page=stwwt_error_logs2.538.49

Server storage [IO: ▲0.33MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/shrinktheweb-website-preview-plugin/" and "wp-content/uploads/"
    • (new file) wp-content/stw-thumbnails/.empty
Filesystem: 22 new files
Database: 1 new table, 10 new options
New tables
wp_stw_error_log
New WordPress options
widget_recent-posts
stwwt_dismiss_notice_time
can_compress_scripts
db_upgraded
stwwt_main_settings_version
stwwt_dismiss_notice
stwwt_main_settings
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for ShrinkTheWeb (STW) Website Previews Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.20 ▼0.351.74 ▲0.1246.10 ▲2.42
Dashboard /wp-admin2,230 ▲595.49 ▼0.0488.08 ▼1.1240.03 ▲3.63
Posts /wp-admin/edit.php2,138 ▲351.99 ▼0.0236.38 ▼5.1035.49 ▼1.85
Add New Post /wp-admin/post-new.php1,557 ▲2023.41 ▲5.35673.71 ▲81.1953.62 ▼11.21
Media Library /wp-admin/upload.php1,438 ▲354.17 ▼0.0295.36 ▲0.7440.71 ▼2.58
How to use /wp-admin/admin.php?page=stwwt_documentation9601.9921.7145.24
Shrink The Web /wp-admin/admin.php?page=stwwt_menu_main2,0201.7324.3944.89
Thumbnail Cache /wp-admin/admin.php?page=stwwt_thumb_cache8432.0324.1330.90
Error Logs /wp-admin/admin.php?page=stwwt_error_logs8212.1624.3825.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_formbuilder.inc.php+74
    Methods with the same name as their class will not be constructors in a future version of PHP; FormBuilder has a deprecated constructor
  • Zombie tables were found after uninstall: 1 table
    • wp_stw_error_log
  • Zombie WordPress options detected upon uninstall: 10 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • stwwt_main_settings
    • stwwt_dismiss_notice_time
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • stwwt_main_settings_version
    • stwwt_dismiss_notice

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stwwt_error_logs
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_formbuilder.inc.php+74
    Methods with the same name as their class will not be constructors in a future version of PHP; FormBuilder has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stwwt_error_logs
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_formbuilder.inc.php+743
    Methods with the same name as their class will not be constructors in a future version of PHP; FormElement has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stwwt_error_logs
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_pagebuilder.inc.php+23
    Methods with the same name as their class will not be constructors in a future version of PHP; PageBuilder has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stwwt_error_logs
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_tablebuilder.inc.php+24
    Methods with the same name as their class will not be constructors in a future version of PHP; TableBuilder has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stwwt_error_logs
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_tablebuilder.inc.php+156
    Methods with the same name as their class will not be constructors in a future version of PHP; RowData has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stwwt_error_logs
    • > Deprecated in wp-content/plugins/shrinktheweb-website-preview-plugin/wplib/utils_tablebuilder.inc.php+199
    Methods with the same name as their class will not be constructors in a future version of PHP; TableColumn has a deprecated constructor

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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/shrinktheweb-website-preview-plugin/lib/admin_only.inc.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/shrinktheweb-website-preview-plugin/stw-wp-thumbnails.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'SettingsForm' not found in wp-content/plugins/shrinktheweb-website-preview-plugin/lib/stw_settings_class.inc.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=stwwt_menu_main
    • > Network (severe)
    https://shrinktheweb.com/uploads/stw-banners/shrinktheweb-234x60.gif - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 96% 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
5 plugin tags: thumbnails, preview, screenshot, website screenshots, snapshot

shrinktheweb-website-preview-plugin/stw-wp-thumbnails.php 92% from 13 tests

The main PHP file in "ShrinkTheWeb (STW) Website Previews Plugin" ver. 2.8.5 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("shrinktheweb-website-preview-plugin.php" instead of "stw-wp-thumbnails.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin4,085 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP109221,5852,951
PO File1190219687
CSS1428228
JavaScript1183219

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity33.33
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods92
▷ Static methods22.17%
▷ Public methods7783.70%
▷ Protected methods1111.96%
▷ Private methods44.35%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon_tick.png0.52KB0.52KB0.00%
img/icon_padlock.png1.44KB1.36KB▼ 5.36%
img/stw_bubble_example.png8.96KB7.91KB▼ 11.66%
img/wpthumb-tinymce-button-icon.png2.52KB1.68KB▼ 33.20%
img/icon_cross.png0.75KB0.65KB▼ 12.83%