89% lmp-pregnancy-calculator

Code Review | LMP Pregnancy Calculator

WordPress plugin LMP Pregnancy Calculator scored89%from 54 tests.

About plugin

  • Plugin page: lmp-pregnancy-cal...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 6.3.1
  • First release: Jan 13, 2022
  • Latest release: Jan 13, 2022
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: wpyork (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼9.68ms] Passed 4 tests

A check of server-side resources used by LMP Pregnancy Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.86 ▼1.20
Dashboard /wp-admin3.36 ▲0.0149.36 ▼12.86
Posts /wp-admin/edit.php3.41 ▲0.0546.13 ▼8.48
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.05 ▼16.17
Media Library /wp-admin/upload.php3.28 ▲0.0543.65 ▲5.29

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

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

Browser metrics Passed 4 tests

Checking browser requirements for LMP Pregnancy Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.14 ▼1.252.26 ▲0.11105.02 ▲63.30
Dashboard /wp-admin2,203 ▲155.84 ▲0.9798.54 ▼6.5142.69 ▼1.37
Posts /wp-admin/edit.php2,092 ▲31.98 ▼0.0636.36 ▼8.2331.90 ▼5.64
Add New Post /wp-admin/post-new.php1,537 ▲1923.07 ▲0.01692.37 ▲90.0468.46 ▲14.00
Media Library /wp-admin/upload.php1,391 ▲64.23 ▼0.03109.78 ▲5.3952.12 ▲6.83

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots need descriptions #1, #2, #3 in lmp-pregnancy-calculator/assets to your readme.txt
  • Requires at least: Invalid plugin version format
You can look at the official readme.txt

lmp-pregnancy-calculator/pregnancy-calculator.php 85% from 13 tests

This is the main PHP file of "LMP Pregnancy Calculator" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("lmp-pregnancy-calculator.php" instead of "pregnancy-calculator.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin503 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP16467261
CSS160242

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.26MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
background-dots-light.png247.30KB95.83KB▼ 61.25%
calendar-icon.png16.08KB7.42KB▼ 53.87%