78% auto-post-thumbnail

Code Review | Auto Featured Image (Auto Post Thumbnail)

WordPress plugin Auto Featured Image (Auto Post Thumbnail) scored 78% from 54 tests.

About plugin

Code review

54 tests

User reviews

106 reviews

Install metrics

70,000+ active / 1,596,260 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲2.67MB] [CPU: ▲16.92ms] Passed 4 tests

Server-side resources used by Auto Featured Image (Auto Post Thumbnail)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.10 ▲1.6449.17 ▲7.53
Dashboard /wp-admin6.39 ▲3.0967.37 ▲23.90
Posts /wp-admin/edit.php6.41 ▲3.0676.96 ▲28.03
Add New Post /wp-admin/post-new.php8.91 ▲3.0299.93 ▲8.23
Media Library /wp-admin/upload.php6.19 ▲2.9663.48 ▲28.52
Add from APT /wp-admin/upload.php?page=menu-media-apt6.2054.15
Settings /wp-admin/admin.php?page=wapt_settings-wbcr_apt7.21340.07
Generate images /wp-admin/admin.php?page=wapt_generate-wbcr_apt6.4057.00
Image /wp-admin/admin.php?page=wapt_image-wbcr_apt7.1775.55
About /wp-admin/admin.php?page=wapt_about-wbcr_apt6.2354.87
License /wp-admin/admin.php?page=license-wbcr_apt6.2258.82
Logs /wp-admin/admin.php?page=wapt_logger-wbcr_apt6.2254.50

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

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 3 files (0.40KB) illegally modified outside of "wp-content/plugins/auto-post-thumbnail/" and "wp-content/uploads/"
    • (new file) wp-content/logs/wbcr_apt/.htaccess
    • (new file) wp-content/logs/wbcr_apt/index.html
    • (new file) wp-content/logs/wbcr_apt/app.log
Filesystem: 427 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
wapt_plugin_activated
wapt_plugin_version
theysaidso_admin_options
wapt_google_limit

Browser metrics Passed 4 tests

A check of browser resources used by Auto Featured Image (Auto Post Thumbnail)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,079 ▲34414.91 ▲0.631.70 ▼0.6738.43 ▼13.38
Dashboard /wp-admin2,485 ▲2976.62 ▲0.80142.55 ▲37.5946.21 ▲2.34
Posts /wp-admin/edit.php2,471 ▲3823.71 ▲1.7252.00 ▲16.6781.90 ▲49.50
Add New Post /wp-admin/post-new.php1,587 ▲5223.25 ▼0.15651.04 ▼43.1835.95 ▼26.79
Media Library /wp-admin/upload.php1,469 ▲814.21 ▲0.0182.14 ▼24.0741.58 ▼7.35
Add from APT /wp-admin/upload.php?page=menu-media-apt1,0743.3745.8370.77
Settings /wp-admin/admin.php?page=wapt_settings-wbcr_apt1,8003.5266.38107.50
Generate images /wp-admin/admin.php?page=wapt_generate-wbcr_apt1,5295.1095.3595.13
Image /wp-admin/admin.php?page=wapt_image-wbcr_apt1,9683.9373.6487.73
About /wp-admin/admin.php?page=wapt_about-wbcr_apt1,5483.3641.58129.11
License /wp-admin/admin.php?page=license-wbcr_apt1,3043.3143.8587.46
Logs /wp-admin/admin.php?page=wapt_logger-wbcr_apt1,2783.3645.6552.88

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • wapt_plugin_version
    • widget_recent-comments
    • wapt_google_limit
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • wapt_plugin_activated

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/auto-post-thumbnail/admin/views/sources/google.php:3
    • > PHP Warning
      Use of undefined constant WAPT_PLUGIN_URL - assumed 'WAPT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/auto-post-thumbnail/admin/views/media-library.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/auto-post-thumbnail/admin/views/tab-license.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Wbcr_FactoryForms463_FontControl' not found in wp-content/plugins/auto-post-thumbnail/libs/factory/forms/controls/google-font.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/auto-post-thumbnail/libs/factory/processing/includes/wp-background-processing.php:23
    • > PHP Warning
      Use of undefined constant WAPT_PLUGIN_URL - assumed 'WAPT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/auto-post-thumbnail/admin/views/sources/google.php on line 2
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/auto-post-thumbnail/admin/views/tab-generate.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url_raw() in wp-content/plugins/auto-post-thumbnail/admin/views/tab-about.php:201
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_116\\Pages\\Step' not found in wp-content/plugins/auto-post-thumbnail/libs/factory/templates/pages/setup-parts/class-step-custom.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/auto-post-thumbnail/admin/views/pro_column.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=wapt_about-wbcr_apt
    • > Network (severe)
    wp-content/plugins/auto-post-thumbnail/admin/assets/img/about/icon-1.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 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
5 plugin tags: featured image from title, thumbnails, elementor, featured image, post thumbnails

auto-post-thumbnail/auto-post-thumbnail.php 85% from 13 tests

"Auto Featured Image (Auto Post Thumbnail)" version 3.9.18's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 238 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected30,105 lines of code in 309 files:
LanguageFilesBlank linesComment linesLines of code
PHP1724,80610,75417,040
CSS525726014,677
JavaScript647821,3213,317
LESS7456952,217
JSON1001,810
PO File83534281,000
SVG30024
Markdown26020

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity15.92
▷ Minimum class complexity1.00
▷ Maximum class complexity205.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces18
Interfaces3
Traits1
Classes138
▷ Abstract classes2014.49%
▷ Concrete classes11885.51%
▷ Final classes21.69%
Methods1,045
▷ Static methods656.22%
▷ Public methods81477.89%
▷ Protected methods17416.65%
▷ Private methods575.45%
Functions34
▷ Named functions1647.06%
▷ Anonymous functions1852.94%
Constants83
▷ Global constants6679.52%
▷ Class constants1720.48%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
45 PNG files occupy 0.21MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/about/interface-3.png3.09KB3.09KB0.00%
admin/assets/jquery-ui/images/ui-bg_gloss-wave_75_2191c0_500x100.png5.84KB2.74KB▼ 53.09%
libs/factory/templates/pages/templates/impressive-lite/assets/img/5-stars22.png3.51KB0.70KB▼ 79.99%
admin/assets/jquery-ui/images/ui-icons_f5e175_256x240.png4.44KB4.17KB▼ 6.02%
admin/assets/jquery-ui/images/ui-icons_056b93_256x240.png4.44KB4.17KB▼ 6.02%