89% meta-preview

Code Review | Drewl Meta Preview

WordPress plugin Drewl Meta Preview scored89%from 54 tests.

About plugin

  • Plugin page: meta-preview
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 4, 2022
  • Latest release: Oct 6, 2022
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: drewlstudio (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /189 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.19ms] Passed 4 tests

This is a short check of server-side resources used by Drewl Meta Preview
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.23 ▼3.76
Dashboard /wp-admin3.35 ▲0.0550.30 ▲4.01
Posts /wp-admin/edit.php3.40 ▲0.0452.14 ▼2.23
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.12 ▼20.28
Media Library /wp-admin/upload.php3.27 ▲0.0435.44 ▲1.51

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Drewl Meta Preview
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5913.18 ▼1.571.73 ▼0.2438.46 ▼4.26
Dashboard /wp-admin2,203 ▲185.78 ▼0.0898.61 ▼4.5842.19 ▼3.21
Posts /wp-admin/edit.php2,092 ▲32.04 ▼0.0242.20 ▲0.8835.94 ▼0.70
Add New Post /wp-admin/post-new.php6,249 ▲4,72026.03 ▲7.69951.56 ▲334.3761.65 ▲4.74
Media Library /wp-admin/upload.php1,385 ▼64.22 ▼0.00110.15 ▲6.5048.34 ▲3.66

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: og, open graph, seo, meta, preview...

meta-preview/drewl-meta-preview.php 85% from 13 tests

The main PHP file in "Drewl Meta Preview" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("meta-preview.php" instead of "drewl-meta-preview.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin991 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
Sass2390409
PHP55435227
JavaScript15033206
Markdown2470118
PO File161127
SVG1003
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods562.50%
▷ Protected methods00.00%
▷ Private methods337.50%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/google.png2.43KB2.16KB▼ 11.29%
admin/images/facebook.png2.11KB2.04KB▼ 3.19%
admin/images/pinterest.png3.39KB2.68KB▼ 21.01%
admin/images/twitter.png2.03KB2.14KB0.00%
admin/images/slack.png2.39KB2.37KB▼ 0.70%