78% smart-pregnancy-calculator

Code Review | Smart Pregnancy Calculator

WordPress plugin Smart Pregnancy Calculator scored78%from 54 tests.

About plugin

  • Plugin page: smart-pregnancy-c...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Jun 10, 2022
  • Latest release: Jun 10, 2022
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: hayyatapps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /424 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
Install script ran successfully

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

An overview of server-side resources used by Smart Pregnancy Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.61 ▼1.11
Dashboard /wp-admin3.32 ▲0.0248.40 ▼2.19
Posts /wp-admin/edit.php3.37 ▲0.0252.18 ▼8.73
Add New Post /wp-admin/post-new.php5.92 ▲0.04103.95 ▼4.49
Media Library /wp-admin/upload.php3.24 ▲0.0239.60 ▲1.08

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Smart Pregnancy Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲8413.77 ▼0.522.00 ▼0.0443.83 ▲1.89
Dashboard /wp-admin2,236 ▲484.93 ▲0.07112.60 ▲6.1837.43 ▼5.60
Posts /wp-admin/edit.php2,119 ▲302.24 ▲0.2142.73 ▲0.9129.78 ▼11.46
Add New Post /wp-admin/post-new.php1,549 ▲2018.44 ▲0.43606.78 ▼37.7636.32 ▼16.65
Media Library /wp-admin/upload.php1,421 ▲334.31 ▲0.0897.90 ▼13.7239.75 ▼7.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

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

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smart-pregnancy-calculator/lib/index.php
    • > /wp-content/plugins/smart-pregnancy-calculator/Pages/activation.php
    • > /wp-content/plugins/smart-pregnancy-calculator/Pages/settings.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-pregnancy-calculator/smart-pregnancy-calculator.php:30

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

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: pregnancy calculator, due date calculator, conception date calculator

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

The main PHP file in "Smart Pregnancy Calculator" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,782 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS4102561,483
PHP79427220
JavaScript441275
SVG4004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
JS/tipx/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
JS/tipx/images/ui-icons_555555_256x240.png6.84KB4.18KB▼ 38.84%