10% auto-featured-image-auto-generated

Code Review | Auto Featured Image (Auto Generated)

WordPress plugin Auto Featured Image (Auto Generated) scored10%from 54 tests.

About plugin

  • Plugin page: auto-featured-ima...
  • Plugin version: 1.6.2
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 26, 2023
  • Latest release: Nov 7, 2023
  • Number of updates: 30
  • Update frequency: every 9.5 days
  • Top authors: jodacame (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /3,638 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/auto-featured-image-auto-generated/admin/Admin.class.php+70
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲5.26MB] [CPU: ▼17.02ms] 75% from 4 tests

A check of server-side resources used by Auto Featured Image (Auto Generated)
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.26MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7941.60 ▲4.41
Dashboard /wp-admin9.27 ▲5.9637.81 ▼11.86
Posts /wp-admin/edit.php9.27 ▲5.9137.78 ▼12.39
Add New Post /wp-admin/post-new.php9.27 ▲3.3840.85 ▼48.23
Media Library /wp-admin/upload.php9.27 ▲6.0440.89 ▲8.40
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2739.24

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 215 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
fs_debug_mode
fs_active_plugins
can_compress_scripts
fs_accounts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Auto Featured Image (Auto Generated)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5714.29 ▼0.051.68 ▼0.0332.71 ▼11.96
Dashboard /wp-admin2,224 ▲435.64 ▼0.0785.99 ▼14.3440.30 ▼3.67
Posts /wp-admin/edit.php2,133 ▲302.03 ▲0.0235.45 ▼6.0135.00 ▼0.78
Add New Post /wp-admin/post-new.php1,541 ▲1522.95 ▼0.44624.11 ▲9.5461.80 ▲13.08
Media Library /wp-admin/upload.php1,431 ▲314.22 ▲0.0598.88 ▼11.5243.30 ▲0.79
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0941.6527.4030.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/auto-featured-image-auto-generated/admin/Admin.class.php+70
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • fs_debug_mode
    • fs_active_plugins
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Notice in wp-content/plugins/auto-featured-image-auto-generated/admin/Trigger.class.php+23
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Warning in wp-content/plugins/auto-featured-image-auto-generated/admin/Admin.class.php+71
    Invalid argument supplied for foreach()

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'ATFIT_PLUGIN_DIRadmin/inc/Image.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/auto-featured-image-auto-generated/admin/Trigger.class.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ATFIT_PLUGIN_DIRadmin/inc/Image.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/auto-featured-image-auto-generated/admin/Admin.class.php on line 3
    • > PHP Warning
      require_once(ATFIT_PLUGIN_DIRadmin/inc/Image.class.php): failed to open stream: No such file or directory in wp-content/plugins/auto-featured-image-auto-generated/admin/Admin.class.php on line 3
    • > PHP Warning
      Use of undefined constant ATFIT_PLUGIN_DIR - assumed 'ATFIT_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/auto-featured-image-auto-generated/admin/Trigger.class.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/auto-featured-image-auto-generated/admin/views/settings.php:3
    • > PHP Warning
      Use of undefined constant ATFIT_PLUGIN_DIR - assumed 'ATFIT_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/auto-featured-image-auto-generated/admin/Admin.class.php on line 3
    • > PHP Warning
      require_once(ATFIT_PLUGIN_DIRadmin/inc/Image.class.php): failed to open stream: No such file or directory in wp-content/plugins/auto-featured-image-auto-generated/admin/Trigger.class.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: featured image, auto-generated featured image, image creation, auto-generated image

auto-featured-image-auto-generated/index.php 85% from 13 tests

The main PHP file in "Auto Featured Image (Auto Generated)" ver. 1.6.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 225 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("auto-featured-image-auto-generated.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected38,248 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP1258,38317,44735,841
JSON1001,338
CSS14210495
JavaScript44461344
Markdown1680214
XML13016

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity85.56
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods1,335
▷ Static methods20215.13%
▷ Public methods93570.04%
▷ Protected methods171.27%
▷ Private methods38328.69%
Functions104
▷ Named functions10298.08%
▷ Anonymous functions21.92%
Constants154
▷ Global constants10769.48%
▷ Class constants4730.52%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/dall-e.png5.17KB3.27KB▼ 36.82%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/assets/images/imagick.png1.32KB1.04KB▼ 21.39%
admin/assets/images/pixabay.png5.06KB3.16KB▼ 37.51%
admin/assets/images/solid.png2.11KB1.82KB▼ 13.82%