84% pregnancy-calculator

Code Review | Pregnancy Calculator

WordPress plugin Pregnancy Calculator scored84%from 54 tests.

About plugin

  • Plugin page: pregnancy-calculator
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9.1
  • WordPress version: 6.3.1
  • First release: Jul 23, 2018
  • Latest release: Mar 2, 2022
  • Number of updates: 12
  • Update frequency: every 109.9 days
  • Top authors: maherhossain (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,330 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Pregnancy Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.15 ▲1.98
Dashboard /wp-admin3.32 ▲0.0245.86 ▼1.61
Posts /wp-admin/edit.php3.37 ▲0.0240.89 ▼7.23
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.16 ▼14.36
Media Library /wp-admin/upload.php3.25 ▲0.0234.20 ▼0.18

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Pregnancy Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲12313.47 ▼1.089.88 ▲8.1442.63 ▲1.20
Dashboard /wp-admin2,210 ▲335.62 ▲0.1096.66 ▲7.4845.61 ▲7.16
Posts /wp-admin/edit.php2,112 ▲122.02 ▲0.0036.10 ▲0.8333.34 ▼1.98
Add New Post /wp-admin/post-new.php1,536 ▲1023.04 ▼0.67631.76 ▲26.7852.68 ▲2.38
Media Library /wp-admin/upload.php1,415 ▲124.29 ▲0.1297.16 ▼1.8939.10 ▼9.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pregnancy-calculator/shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pregnancy-calculator/shortcode.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: pregnancy calculator, pregnancy month calculator, pregnancy milestone calculator, pregnancy calendar by due date, simple pregnancy calculator...

pregnancy-calculator/pregnancy-calculator.php 92% from 13 tests

The main PHP script in "Pregnancy Calculator" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 383 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,792 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1181109977
PHP312319711
CSS170104

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions17
▷ Named functions17100.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
No PNG images were found in this plugin