67% magic-post-thumbnail

Code Review | Magic Post Thumbnail

WordPress plugin Magic Post Thumbnail scored67%from 54 tests.

About plugin

  • Plugin page: magic-post-thumbnail
  • Plugin version: 5.0.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 16, 2012
  • Latest release: Nov 25, 2023
  • Number of updates: 150
  • Update frequency: every 28.1 days
  • Top authors: Mcurly (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

10,000+ active /297,094 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.10MB] [CPU: ▲23.51ms] 75% from 4 tests

This is a short check of server-side resources used by Magic Post Thumbnail
Please take the time to fix the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.10MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.92 ▲5.4664.58 ▲21.63
Dashboard /wp-admin8.94 ▲5.6077.40 ▲15.69
Posts /wp-admin/edit.php8.94 ▲5.5990.09 ▲40.21
Add New Post /wp-admin/post-new.php9.65 ▲3.76112.08 ▲16.51
Media Library /wp-admin/upload.php8.94 ▲5.7189.10 ▲57.31
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9467.43

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 506 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
fs_active_plugins
theysaidso_admin_options
widget_recent-comments
fs_accounts
widget_theysaidso_widget
fs_debug_mode

Browser metrics Passed 4 tests

Magic Post Thumbnail: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17815.07 ▲0.3912.78 ▲11.1827.85 ▼15.18
Dashboard /wp-admin2,248 ▲686.05 ▲0.41107.90 ▲5.7344.38 ▼1.40
Posts /wp-admin/edit.php2,174 ▲713.13 ▲1.1545.47 ▲0.8050.14 ▲15.52
Add New Post /wp-admin/post-new.php1,700 ▲17422.05 ▼0.97622.18 ▲13.4529.24 ▼19.19
Media Library /wp-admin/upload.php1,455 ▲585.55 ▲1.36119.21 ▲22.1049.07 ▲6.72
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1102.7431.5825.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/magic-post-thumbnail/admin/partials/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_accounts
    • widget_theysaidso_widget
    • fs_active_plugins
    • fs_debug_mode
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/magic-post-thumbnail/public/partials/magic-post-thumbnail-public-display.php
    • > /wp-content/plugins/magic-post-thumbnail/includes/text-miner/stop-words/index.php
  • 100× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/magic-post-thumbnail/admin/partials/monolog/vendor/psr/log/Psr/Log/Test/TestLogger.php:57

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Magic Post Thumbnail : Bulk Generation), #2 (Magic Post Thumbnail : Gutenberg Block), #3 (Magic post Thumbnail : Settings), #4 (Magic post Thumbnail : Image Banks), #5 (Magic post Thumbnail : Generate featured images for post types), #6 (Magic post Thumbnail : Generate featured images for taxonomies), #7 (Magic post Thumbnail : Generate featured images for each post individually), #8 (Magic post Thumbnail : Crons)
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

magic-post-thumbnail/magic-post-thumbnail.php 92% from 13 tests

"Magic Post Thumbnail" version 5.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 155 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin144,521 lines of code in 354 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1716,71312,17381,116
PHP28810,84123,20546,059
CSS352,2716113,575
PO File21,0642,2552,498
Markdown51940698
SVG113337
JSON600238

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity32.20
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces12
Interfaces10
Traits5
Classes173
▷ Abstract classes105.78%
▷ Concrete classes16394.22%
▷ Final classes21.23%
Methods2,069
▷ Static methods24011.60%
▷ Public methods1,43969.55%
▷ Protected methods1738.36%
▷ Private methods45722.09%
Functions128
▷ Named functions10985.16%
▷ Anonymous functions1914.84%
Constants205
▷ Global constants10048.78%
▷ Class constants10551.22%
▷ Public constants8580.95%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
33 compressed PNG files occupy 0.64MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/source.png0.49KB0.52KB0.00%
admin/img/logs.png0.22KB0.18KB▼ 18.70%
admin/img/home.png0.53KB0.62KB0.00%
admin/img/affiliation.png0.56KB0.69KB0.00%
admin/js/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%