84% post-thumbnail-editor

Code Review | Post Thumbnail Editor

WordPress plugin Post Thumbnail Editor scored84%from 54 tests.

About plugin

  • Plugin page: post-thumbnail-ed...
  • Plugin version: 2.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.5
  • WordPress version: 6.3.1
  • First release: Mar 3, 2011
  • Latest release: Aug 7, 2016
  • Number of updates: 50
  • Update frequency: every 39.7 days
  • Top authors: sewpafly (100%)

Code review

54 tests

User reviews

63 reviews

Install metrics

30,000+ active /390,607 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.09MB] [CPU: ▼13.37ms] Passed 4 tests

This is a short check of server-side resources used by Post Thumbnail Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1038.46 ▲0.89
Dashboard /wp-admin3.40 ▲0.0544.11 ▼19.55
Posts /wp-admin/edit.php3.51 ▲0.1547.04 ▲2.52
Add New Post /wp-admin/post-new.php5.29 ▼0.6070.17 ▼35.16
Media Library /wp-admin/upload.php3.32 ▲0.1035.86 ▲0.34
Post Thumbnail Editor /wp-admin/options-general.php?page=pte3.5233.09
Post Thumbnail Editor /wp-admin/admin.php?page=pte-edit3.2830.28

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 99 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Post Thumbnail Editor: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.57 ▼0.814.56 ▲2.9044.37 ▼4.48
Dashboard /wp-admin2,210 ▲195.87 ▲0.0197.76 ▼21.2041.68 ▼5.84
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0434.35 ▼8.9538.87 ▲3.77
Add New Post /wp-admin/post-new.php1,517 ▼1117.74 ▼0.33607.13 ▼43.8433.94 ▼26.45
Media Library /wp-admin/upload.php1,393 ▲24.24 ▲0.0195.40 ▼13.1640.17 ▼4.97
Post Thumbnail Editor /wp-admin/options-general.php?page=pte9732.0322.6833.61
Post Thumbnail Editor /wp-admin/admin.php?page=pte-edit7442.0523.6622.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/post-thumbnail-editor/post-thumbnail-editor.php:34
    • > PHP Notice
      Undefined variable: meta in wp-content/plugins/post-thumbnail-editor/html/pte.php on line 18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/post-thumbnail-editor/html/pte.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_Imagick' not found in wp-content/plugins/post-thumbnail-editor/php/class-pte-image-editor-imagick.php:3
    • > PHP Warning
      Use of undefined constant PTE_PLUGINPATH - assumed 'PTE_PLUGINPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-thumbnail-editor/php/functions.php on line 6
    • > PHP Warning
      require_once(PTE_PLUGINPATHphp/log.php): failed to open stream: No such file or directory in wp-content/plugins/post-thumbnail-editor/php/functions.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_GD' not found in wp-content/plugins/post-thumbnail-editor/php/class-pte-image-editor-gd.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/post-thumbnail-editor/html/pte.php on line 19
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/post-thumbnail-editor/html/pte.php on line 17
    • > PHP Notice
      Undefined variable: meta in wp-content/plugins/post-thumbnail-editor/html/pte.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Before/After), #2 (To edit from Media Library click "Thumbnail" in the rollover options for the row.), #3 (In the Edit subpage for media locate the box titled "Thumbnail Settings", and click the link to "Post Thumbnail Editor".), #4 (Crop the image as you see fit, select the thumbnails you wish to change, and click "Crop".), #5 (Save the resized/recropped images by clicking the save icon.)
You can take inspiration from this readme.txt

post-thumbnail-editor/post-thumbnail-editor.php Passed 13 tests

The primary PHP file in "Post Thumbnail Editor" version 2.4.8 is used by WordPress to initiate all plugin functionality
40 characters long description:
Individually manage your post thumbnails

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected10,494 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript173767023,048
PHP93465791,882
CSS617391,676
Sass131922928
LESS121827907
PO File6477657881
CoffeeScript11120207616
SVG100414
HTML113071
Markdown115051
make171220

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.88
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods46
▷ Static methods1839.13%
▷ Public methods3473.91%
▷ Protected methods613.04%
▷ Private methods613.04%
Functions69
▷ Named functions69100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants426.67%
▷ Class constants1173.33%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin