79% automatic-post-media

Code Review | Automatic Post Media

WordPress plugin Automatic Post Media scored79%from 54 tests.

About plugin

  • Plugin page: automatic-post-media
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.0.3
  • WordPress version: 6.3.1
  • First release: Feb 17, 2019
  • Latest release: Feb 17, 2019
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: bestony (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /809 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼11.91ms] Passed 4 tests

Analyzing server-side resources used by Automatic Post Media
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.41 ▼3.13
Dashboard /wp-admin3.34 ▼0.0145.24 ▼21.25
Posts /wp-admin/edit.php3.39 ▲0.0351.01 ▲2.13
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.68 ▼23.95
Media Library /wp-admin/upload.php3.26 ▲0.0336.22 ▲0.69
Automatic Post Media /wp-admin/options-general.php?page=_automatic_post_media3.2034.68

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Automatic Post Media
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.72 ▲0.371.54 ▲0.0836.85 ▼3.95
Dashboard /wp-admin2,199 ▲255.56 ▼0.1184.75 ▼5.4837.88 ▼2.70
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0240.03 ▲5.7434.89 ▲0.93
Add New Post /wp-admin/post-new.php1,531 ▲523.18 ▼0.01678.89 ▼23.7656.88 ▲4.38
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.0193.37 ▼13.9145.32 ▼1.25
Automatic Post Media /wp-admin/options-general.php?page=_automatic_post_media8861.9921.9039.37

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=_automatic_post_media
    • > Notice in wp-content/plugins/automatic-post-media/options.php+112
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/automatic-post-media/automatic-post-media.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/automatic-post-media/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
1 plugin tags: media library

automatic-post-media/automatic-post-media.php Passed 13 tests

"Automatic Post Media" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
30 characters long description:
Automatic Post Media as a Post

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin187 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24312143
PO File1111244

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected