84% preload-lcp-image

Code Review | Preload LCP Image

WordPress plugin Preload LCP Image scored84%from 54 tests.

About plugin

  • Plugin page: preload-lcp-image
  • Plugin version: 1.0.3
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.1-6.4
  • WordPress version: 6.3.1
  • First release: Jan 31, 2023
  • Latest release: Oct 26, 2023
  • Number of updates: 9
  • Update frequency: every 30.3 days
  • Top authors: rhyswynne (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,006 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.67ms] Passed 4 tests

Analyzing server-side resources used by Preload LCP Image
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.19 ▼5.36
Dashboard /wp-admin3.32 ▲0.0144.22 ▼1.54
Posts /wp-admin/edit.php3.45 ▲0.1046.78 ▼1.38
Add New Post /wp-admin/post-new.php5.92 ▲0.04100.14 ▲12.34
Media Library /wp-admin/upload.php3.24 ▲0.0137.63 ▲1.61
Preload LCP Image /wp-admin/options-general.php?page=preloadlcpimage3.2131.22

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Preload LCP Image
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.36 ▼0.231.90 ▲0.0937.86 ▼3.10
Dashboard /wp-admin2,202 ▲255.64 ▲0.0482.86 ▼10.3139.22 ▼1.05
Posts /wp-admin/edit.php2,269 ▲1663.44 ▲1.4387.09 ▲48.4429.26 ▼7.65
Add New Post /wp-admin/post-new.php6,250 ▲4,72226.13 ▲3.05995.39 ▲321.5943.44 ▼19.49
Media Library /wp-admin/upload.php1,398 ▼54.00 ▼0.18103.87 ▲4.9352.20 ▲10.67
Preload LCP Image /wp-admin/options-general.php?page=preloadlcpimage8522.0027.1631.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(DR_PRELOAD_LCP_PATH/inc/metabox.php): failed to open stream: No such file or directory in wp-content/plugins/preload-lcp-image/inc/core.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preload-lcp-image/inc/enqueue.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preload-lcp-image/inc/metabox.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/preload-lcp-image/index.php:13
    • > PHP Warning
      Use of undefined constant DR_PRELOAD_LCP_PATH - assumed 'DR_PRELOAD_LCP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/preload-lcp-image/inc/core.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preload-lcp-image/inc/options.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preload-lcp-image/inc/display.php:63
    • > PHP Fatal error
      require_once(): Failed opening required 'DR_PRELOAD_LCP_PATH/inc/metabox.php' (include_path='.:/usr/share/php') in wp-content/plugins/preload-lcp-image/inc/core.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: lcp, site optimisation, site speed, preload, largest contentful paint...

preload-lcp-image/index.php 92% from 13 tests

The main PHP script in "Preload LCP Image" version 1.0.3 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("preload-lcp-image.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin335 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP88794259
CSS110152
JavaScript1171424

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG files were detected