84% lazy-embeds

Code Review | Lazy Embeds

WordPress plugin Lazy Embeds scored84%from 54 tests.

About plugin

  • Plugin page: lazy-embeds
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Jan 8, 2020
  • Latest release: Jan 9, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: danielpost (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /507 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.48ms] Passed 4 tests

This is a short check of server-side resources used by Lazy Embeds
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.69 ▼7.28
Dashboard /wp-admin3.32 ▲0.0145.86 ▼2.01
Posts /wp-admin/edit.php3.37 ▲0.0145.69 ▼4.68
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.94 ▼9.94
Media Library /wp-admin/upload.php3.24 ▲0.0131.86 ▼4.00

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Lazy Embeds
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.27 ▼1.112.05 ▲0.2844.72 ▼0.89
Dashboard /wp-admin2,209 ▲245.91 ▲0.1099.44 ▼5.2638.83 ▼1.67
Posts /wp-admin/edit.php2,089 ▼32.03 ▲0.0136.56 ▼7.1533.29 ▼2.83
Add New Post /wp-admin/post-new.php1,533 ▼123.35 ▲0.44676.94 ▲63.5757.28 ▼17.38
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0396.43 ▼5.9940.90 ▼2.70

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

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)
Everything seems fine, however 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 fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Lazy_Embeds\\Base' not found in wp-content/plugins/lazy-embeds/includes/class-vimeo.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Lazy_Embeds\\Base' not found in wp-content/plugins/lazy-embeds/includes/class-youtube.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: videos, vimeo, video, embed, embeds...

lazy-embeds/lazy-embeds.php Passed 13 tests

The principal PHP file in "Lazy Embeds" v. 1.0.0 is loaded by WordPress automatically on each request
43 characters long description:
Lazy embeds for the WordPress Block Editor.

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
Everything looks great! No dangerous files found in this plugin230 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP77297228
CSS1001
JavaScript1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.75
▷ Minimum class complexity2.00
▷ Maximum class complexity15.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1157.89%
▷ Protected methods00.00%
▷ Private methods842.11%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin