78% attach-post-images

Code Review | Attach Post Images

WordPress plugin Attach Post Images scored78%from 54 tests.

About plugin

  • Plugin page: attach-post-images
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2014
  • Latest release: Mar 9, 2014
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: tcyr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,720 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.13ms] Passed 4 tests

This is a short check of server-side resources used by Attach Post Images
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.38 ▼2.48
Dashboard /wp-admin3.34 ▲0.0347.16 ▼2.51
Posts /wp-admin/edit.php3.39 ▲0.0352.09 ▲1.18
Add New Post /wp-admin/post-new.php5.94 ▲0.0696.75 ▼5.48
Media Library /wp-admin/upload.php3.26 ▲0.0335.46 ▼2.06

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Attach Post Images: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.031.63 ▲0.1438.96 ▼1.49
Dashboard /wp-admin2,195 ▲155.64 ▼0.0391.71 ▲3.1039.53 ▼4.64
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0441.51 ▼0.1636.82 ▼2.63
Add New Post /wp-admin/post-new.php6,243 ▲4,71718.91 ▼4.60907.43 ▲229.0056.83 ▲3.59
Media Library /wp-admin/upload.php1,403 ▲94.15 ▼0.0594.16 ▼8.7443.09 ▼2.17

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/attach-post-images/metabox.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: images_str in wp-content/plugins/attach-post-images/metabox.php on line 6
    • > PHP Notice
      Undefined variable: href in wp-content/plugins/attach-post-images/metabox.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/attach-post-images/attach-post-images.php:20

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: widget, attach images to post, post images, attach images, posts

attach-post-images/attach-post-images.php 92% from 13 tests

Analyzing the main PHP file in "Attach Post Images" version 1.0.1
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 368 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin311 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34570164
JavaScript11912101
CSS18746

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods872.73%
▷ Protected methods19.09%
▷ Private methods218.18%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected