10% canonical-attachments

Code Review | Canonical Attachments

WordPress plugin Canonical Attachments scored 10% from 54 tests.

About plugin

  • Plugin page: canonical-attachm...
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.1-5.6
  • WordPress version: 5.8.1
  • First release: Jan 19, 2017
  • Latest release: Dec 30, 2020
  • Number of updates: 8
  • Update frequency: every 179.4 days
  • Top authors: hivedigital (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active / 3,956 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/canonical-attachments/canonical-attachments.php+20
    file_get_contents(wp-content/uploads/.htaccess): failed to open stream: No such file or directory

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

This is a short check of server-side resources used by Canonical Attachments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1528.95 ▲6.67
Dashboard /wp-admin3.10 ▲0.0445.26 ▼4.15
Posts /wp-admin/edit.php3.15 ▲0.0446.08 ▲9.87
Add New Post /wp-admin/post-new.php5.45 ▲0.0187.13 ▼568.39
Media Library /wp-admin/upload.php3.04 ▲0.0333.90 ▲4.62
Edit .htaccess /wp-admin/admin.php?page=htaccess-edits3.0228.68
Canonicals /wp-admin/upload.php?page=canonical-attachments3.1431.57

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Canonical Attachments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,777 ▲18216.04 ▲0.158.72 ▲0.3746.43 ▼6.77
Dashboard /wp-admin3,059 ▲1286.12 ▲0.16134.14 ▼2.31106.25 ▼8.64
Posts /wp-admin/edit.php2,842 ▲1032.76 ▲0.0466.05 ▼1.3288.15 ▼5.29
Add New Post /wp-admin/post-new.php1,681 ▲921.90 ▲3.05282.55 ▼100.04104.95 ▼13.14
Media Library /wp-admin/upload.php1,909 ▲1025.13 ▲0.11143.36 ▲0.03117.39 ▼11.63
Edit .htaccess /wp-admin/admin.php?page=htaccess-edits1,2002.1255.3981.90
Canonicals /wp-admin/upload.php?page=canonical-attachments1,4122.1354.9273.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/upload.php?page=canonical-attachments
    • > Notice in wp-content/plugins/canonical-attachments/tools/bulk-editor.php+184
    Undefined index: filter

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/canonical-attachments/templates/header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/canonical-attachments/templates/footer.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: canonical tags, canonicalize, canonical, ppt, doc...

canonical-attachments/canonical-attachments.php 92% from 13 tests

The main PHP file in "Canonical Attachments" ver. 1.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 240 characters long)

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
Success! There were no dangerous files found in this plugin519 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP56849519

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.51MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png124.35KB52.32KB▼ 57.92%
screenshot-1.png128.97KB55.11KB▼ 57.27%
screenshot-5.png62.51KB27.11KB▼ 56.64%
screenshot-4.png78.79KB36.57KB▼ 53.58%
templates/Hive-Digital-Logo.png6.15KB2.93KB▼ 52.43%