89% opening-hours

Code Review | We’re Open!

WordPress plugin We’re Open! scored89%from 54 tests.

About plugin

  • Plugin page: opening-hours
  • Plugin version: 1.55
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Aug 11, 2008
  • Latest release: Nov 8, 2023
  • Number of updates: 521
  • Update frequency: every 10.7 days
  • Top authors: designextreme (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

4,000+ active /59,491 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.47MB] [CPU: ▲15.93ms] 75% from 4 tests

An overview of server-side resources used by We’re Open!
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 879.87ms on /wp-admin/options-general.php?page=opening_hours_settings)
PageMemory (MB)CPU Time (ms)
Home /5.00 ▲1.5360.91 ▲21.95
Dashboard /wp-admin4.82 ▲1.51102.19 ▲53.63
Posts /wp-admin/edit.php4.86 ▲1.5064.50 ▲15.03
Add New Post /wp-admin/post-new.php7.33 ▲1.43100.46 ▲5.23
Media Library /wp-admin/upload.php4.67 ▲1.4454.71 ▲21.50
We’re Open! /wp-admin/options-general.php?page=opening_hours_settings5.35879.87

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 32 new options
New WordPress options
theysaidso_admin_options
we_are_open_day_range_separator
we_are_open_weekdays
we_are_open_javascript
we_are_open_day_format_special
we_are_open_time_separator
widget_recent-comments
we_are_open_closed_text
we_are_open_week_start
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for We’re Open!
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲17813.47 ▼1.278.97 ▲7.3745.37 ▲5.11
Dashboard /wp-admin2,237 ▲605.64 ▼0.0394.84 ▼4.4243.08 ▼3.23
Posts /wp-admin/edit.php2,139 ▲392.02 ▲0.0540.36 ▼2.6936.16 ▲0.06
Add New Post /wp-admin/post-new.php1,541 ▲1522.91 ▼0.06663.68 ▼4.8157.76 ▲4.35
Media Library /wp-admin/upload.php1,440 ▲374.20 ▲0.0597.92 ▼4.5046.49 ▼0.20
We’re Open! /wp-admin/options-general.php?page=opening_hours_settings5,8213.4957.3430.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: open times, structured data, google my business, opening hours, opening times...

opening-hours/opening-hours.php Passed 13 tests

The principal PHP file in "We’re Open!" v. 1.55 is loaded by WordPress automatically on each request
139 characters long description:
Smart and easy management for your business’ regular and special opening hours with Structured Data plus populate from Google My Business

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected11,543 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP71,1501088,209
CSS21421,707
JavaScript231331,561
SVG10066

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,377)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 412)
Cyclomatic complexity
Average complexity per logical line of code1.00
Average class complexity943.00
▷ Minimum class complexity3.00
▷ Maximum class complexity2,377.00
Average method complexity33.48
▷ Minimum method complexity1.00
▷ Maximum method complexity412.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods75
▷ Static methods79.33%
▷ Public methods5674.67%
▷ Protected methods00.00%
▷ Private methods1925.33%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin