84% lazy-embed

Code Review | Lazy Embed

WordPress plugin Lazy Embed scored84%from 54 tests.

About plugin

  • Plugin page: lazy-embed
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2023
  • Latest release: Mar 3, 2023
  • Number of updates: 10
  • Update frequency: every 2.9 days
  • Top authors: beleaf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /343 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.04MB] [CPU: ▼5.68ms] Passed 4 tests

Analyzing server-side resources used by Lazy Embed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0636.86 ▼10.72
Dashboard /wp-admin3.35 ▲0.0449.26 ▼4.03
Posts /wp-admin/edit.php3.40 ▲0.0451.64 ▲5.12
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.15 ▼9.35
Media Library /wp-admin/upload.php3.27 ▲0.0438.56 ▲1.37

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Lazy Embed: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.381.80 ▲0.0341.62 ▼6.97
Dashboard /wp-admin2,195 ▲185.61 ▲0.0191.31 ▼4.5141.55 ▼1.77
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0638.71 ▲2.4336.10 ▲4.15
Add New Post /wp-admin/post-new.php1,535 ▲918.35 ▼5.25621.88 ▼110.2661.34 ▲7.60
Media Library /wp-admin/upload.php1,397 ▼04.19 ▼0.04101.46 ▲3.6146.46 ▲5.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BeleafLazyEmbed\\add_action() in wp-content/plugins/lazy-embed/lazy-embed.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 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
8 plugin tags: embed, sustainability, vimeo, lazyload, lazy...

lazy-embed/lazy-embed.php 92% from 13 tests

This is the main PHP file of "Lazy Embed" version 1.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires PHP: Required version does not match the one declared in readme.txt ("5.6" instead of "7.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected242 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP26240204
CSS15037
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods19100.00%
▷ Public methods315.79%
▷ Protected methods00.00%
▷ Private methods1684.21%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.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
No PNG files were detected