10% attach-embeds

Code Review | Attach Embeds

WordPress plugin Attach Embeds scored10%from 54 tests.

About plugin

  • Plugin page: attach-embeds
  • Plugin version: 1.5.1614271328-16142...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 31, 2020
  • Latest release: Feb 25, 2021
  • Number of updates: 8
  • Update frequency: every 49.4 days
  • Top authors: attachlive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,917 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/attach-embeds/public/class-attach-embeds-public.php+77
    Undefined variable: attach_embeds

Server metrics [RAM: ▼1.82MB] [CPU: ▼57.66ms] Passed 4 tests

A check of server-side resources used by Attach Embeds
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.18 ▼1.285.99 ▼32.76
Dashboard /wp-admin2.20 ▼1.156.79 ▼55.13
Posts /wp-admin/edit.php2.20 ▼1.167.51 ▼40.42
Add New Post /wp-admin/post-new.php2.20 ▼3.696.22 ▼102.34
Media Library /wp-admin/upload.php2.20 ▼1.037.06 ▼26.34
Preview Embed /wp-admin/admin.php?page=attach_embeds_preview2.206.32
Setup /wp-admin/admin.php?page=attach_embeds_settings2.207.31
Reactions Embed /wp-admin/admin.php?page=attach_embeds_reactions2.206.66

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Attach Embeds
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲8114.34 ▼0.402.01 ▲0.0642.08 ▲6.47
Dashboard /wp-admin2,226 ▲485.55 ▼0.1492.86 ▼23.7870.97 ▲32.50
Posts /wp-admin/edit.php2,140 ▲402.01 ▼0.0139.87 ▼0.6433.98 ▼0.94
Add New Post /wp-admin/post-new.php1,557 ▲3123.03 ▲0.00672.58 ▲51.0556.08 ▲7.98
Media Library /wp-admin/upload.php1,431 ▲314.14 ▼0.0799.96 ▲4.4480.39 ▲37.18
Preview Embed /wp-admin/admin.php?page=attach_embeds_preview8762.0526.7231.60
Setup /wp-admin/admin.php?page=attach_embeds_settings9072.3123.1526.80
Reactions Embed /wp-admin/admin.php?page=attach_embeds_reactions8852.0524.1227.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/attach-embeds/public/class-attach-embeds-public.php+77
    Undefined variable: attach_embeds
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • enable_preview_first_time
    • preview_default_css
    • can_compress_scripts
    • db_upgraded
    • reaction_default_css
    • theysaidso_admin_options
    • enable_reactions_first_time
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=attach_embeds_reactions
    • > Notice in wp-content/plugins/attach-embeds/public/class-attach-embeds-public.php+77
    Undefined variable: attach_embeds

SRP 0% 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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/attach-embeds/public/partials/attach-embeds-public-display.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/attach-embeds/admin/partials/attach-embeds-admin-display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/attach-embeds/admin/partials/attach-embeds-reactions-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/attach-embeds/admin/partials/attach-embeds-preview-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (screenshot-ui-reactions.png), #2 (screenshot-admin-setup.png), #3 (screenshot-admin-reactions.png)
  • Screenshots: Add descriptions for screenshots #0, #0, #0 in attach-embeds/assets to your readme.txt
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

attach-embeds/attach-embeds.php 85% from 13 tests

"Attach Embeds" version 1.5.1614271328-16142...'s primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 203 characters long)
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "1.5.1614271328-16142...")

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
Everything looks great! No dangerous files found in this plugin947 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP14426525589
PO File35472245
CSS20865
JavaScript2116329
SVG12019

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.86
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods47
▷ Static methods24.26%
▷ Public methods4289.36%
▷ Protected methods00.00%
▷ Private methods510.64%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.29MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png9.78KB4.37KB▼ 55.33%
assets/icon-128x128.png1.87KB1.37KB▼ 26.84%
assets/screenshot-admin-reactions.png77.19KB22.64KB▼ 70.67%
assets/banner-1544x500.png23.25KB9.26KB▼ 60.17%
assets/screenshot-admin-setup.png81.28KB25.15KB▼ 69.05%