84% eddards-post-attachments

Code Review | Eddard's Post Attachments

WordPress plugin Eddard's Post Attachments scored84%from 54 tests.

About plugin

  • Plugin page: eddards-post-atta...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 19, 2015
  • Latest release: Jun 19, 2015
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: Eddard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /644 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼8.77ms] Passed 4 tests

Analyzing server-side resources used by Eddard's Post Attachments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.30 ▼7.60
Dashboard /wp-admin3.37 ▲0.0750.31 ▼4.88
Posts /wp-admin/edit.php3.42 ▲0.0647.01 ▼3.25
Add New Post /wp-admin/post-new.php5.97 ▲0.0987.11 ▼19.35
Media Library /wp-admin/upload.php3.29 ▲0.0639.09 ▲3.34

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Eddard's Post Attachments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.36 ▲0.012.18 ▲0.6043.46 ▼3.65
Dashboard /wp-admin2,205 ▲285.65 ▼0.0383.12 ▼16.6036.39 ▼12.31
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0436.50 ▼0.6233.32 ▼4.33
Add New Post /wp-admin/post-new.php1,533 ▲723.33 ▲0.25673.45 ▲4.4754.08 ▼14.45
Media Library /wp-admin/upload.php1,407 ▲74.23 ▲0.02108.17 ▲8.3645.12 ▼1.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/eddards-post-attachments/index.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: post attachments

eddards-post-attachments/index.php 92% from 13 tests

The entry point to "Eddard's Post Attachments" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("eddards-post-attachments.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin693 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP289117296
JavaScript2520165
PO File24848120
CSS1269112

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1071.43%
▷ Protected methods00.00%
▷ Private methods428.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected