84% weheartit-image-embed

Code Review | WeHeartIt Image Embed

WordPress plugin WeHeartIt Image Embed scored84%from 54 tests.

About plugin

  • Plugin page: weheartit-image-e...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-4.0.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2015
  • Latest release: Feb 13, 2015
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: lonuongvit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /679 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
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by WeHeartIt Image Embed
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0245.24 ▲5.79
Dashboard /wp-admin3.33 ▼0.0247.64 ▼13.39
Posts /wp-admin/edit.php3.38 ▲0.0248.53 ▼0.36
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.11 ▼2.00
Media Library /wp-admin/upload.php3.25 ▲0.0238.85 ▲5.16

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WeHeartIt Image Embed
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲11614.40 ▼0.042.16 ▲0.4445.04 ▲4.56
Dashboard /wp-admin2,258 ▲785.60 ▼0.0193.83 ▲5.6038.99 ▼6.21
Posts /wp-admin/edit.php2,211 ▲1112.21 ▲0.1637.12 ▼4.9830.32 ▼6.64
Add New Post /wp-admin/post-new.php1,620 ▲7023.31 ▲0.11681.97 ▲72.5957.37 ▼6.43
Media Library /wp-admin/upload.php1,463 ▲604.25 ▲0.03103.41 ▼3.4945.42 ▼1.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/weheartit-image-embed/index.php:11

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 93% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #3 (`/assets/screenshot-3.jpg`), #4 (`/assets/screenshot-4.jpg`)
The official readme.txt might help

weheartit-image-embed/index.php 92% from 13 tests

The principal PHP file in "WeHeartIt Image Embed" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("weheartit-image-embed.php" instead of "index.php")

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
Everything looks great! No dangerous files found in this plugin1,014 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript119574776
PHP1510209
CSS141129

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/controls.png1.59KB1.67KB0.00%