73% softech-wp-clock

Code Review | Softech Wp Clock

WordPress plugin Softech Wp Clock scored73%from 54 tests.

About plugin

  • Plugin page: softech-wp-clock
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Nov 12, 2018
  • Latest release: May 25, 2019
  • Number of updates: 16
  • Update frequency: every 12.6 days
  • Top authors: shravanchoudhary (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /852 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
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼6.11ms] Passed 4 tests

Server-side resources used by Softech Wp Clock
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1539.63 ▼0.09
Dashboard /wp-admin3.45 ▲0.1150.70 ▼6.78
Posts /wp-admin/edit.php3.56 ▲0.2144.06 ▼3.49
Add New Post /wp-admin/post-new.php6.05 ▲0.1683.54 ▼14.06
Media Library /wp-admin/upload.php3.37 ▲0.1439.85 ▲5.68
Add New /wp-admin/admin.php?page=softech-wp-clock-new-zone3.3131.73
Time Zones /wp-admin/admin.php?page=softech-wp-all-zone-list3.3532.85

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 28 new files
Database: 1 new table, 7 new options
New tables
wp_softech_clock
New WordPress options
theysaidso_admin_options
softech_clock_db_version
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Softech Wp Clock
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲20013.58 ▼0.836.18 ▲4.4242.19 ▼5.51
Dashboard /wp-admin2,236 ▲484.88 ▼0.01106.10 ▲0.6339.34 ▼3.93
Posts /wp-admin/edit.php2,116 ▲272.06 ▲0.0136.14 ▼3.9333.17 ▼3.31
Add New Post /wp-admin/post-new.php1,537 ▲2323.29 ▲5.44730.82 ▲89.9660.61 ▲3.07
Media Library /wp-admin/upload.php1,418 ▲304.24 ▲0.02101.64 ▲2.0448.32 ▲3.88
Add New /wp-admin/admin.php?page=softech-wp-clock-new-zone3,2402.0831.1832.91
Time Zones /wp-admin/admin.php?page=softech-wp-all-zone-list1,1222.0924.0244.52

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • softech_clock_db_version
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+29
    Undefined index: name
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+30
    Undefined index: time_zone
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+31
    Undefined index: bgcolor
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+32
    Undefined index: font_color
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+33
    Undefined index: date_font_size
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+34
    Undefined index: time_font_size
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+35
    Undefined index: zone_font_size
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+36
    Undefined index: padding
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+37
    Undefined index: text_align
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Notice in wp-content/plugins/softech-wp-clock/add-wp-clock.php+38
    Undefined index: clock_style

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/softech-wp-clock/list-wp-clock.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/softech-wp-clock/list-wp-clock.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/softech-wp-clock/softech-wp-clock.php:30
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/softech-wp-clock/list-wp-clock.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/softech-wp-clock/add-shortcode.php:584

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=softech-wp-clock-new-zone 624 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=softech-wp-clock-new-zone
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=softech-wp-clock-new-zone 633 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
Please take inspiration from this readme.txt

softech-wp-clock/softech-wp-clock.php Passed 13 tests

This is the main PHP file of "Softech Wp Clock" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
108 characters long description:
Display a Time zone clock on your page/post set to your city's timezone. Choice of clocks, colors and sizes.

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 plugin2,048 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP41311591,115
PO File6270330765
CSS115132
JavaScript10036

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png13.24KB4.93KB▼ 62.78%
screenshot-5.png65.84KB17.22KB▼ 73.84%
screenshot-2.png26.77KB10.83KB▼ 59.54%