84% periodic-table-widget

Code Review | Periodic Table Widget

WordPress plugin Periodic Table Widget scored84%from 54 tests.

About plugin

  • Plugin page: periodic-table-wi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 17, 2018
  • Latest release: Nov 17, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: mahafuzur (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Periodic Table Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1538.24 ▼3.50
Dashboard /wp-admin3.44 ▲0.1347.27 ▲1.37
Posts /wp-admin/edit.php3.55 ▲0.1949.45 ▲2.49
Add New Post /wp-admin/post-new.php6.02 ▲0.1397.68 ▼5.14
Media Library /wp-admin/upload.php3.36 ▲0.1338.60 ▲4.81

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_periodic_table_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Periodic Table Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲17513.61 ▼1.055.47 ▲3.1537.24 ▼3.82
Dashboard /wp-admin2,206 ▲245.91 ▲0.09108.08 ▲5.3448.97 ▲7.93
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0339.95 ▼0.0735.37 ▲0.32
Add New Post /wp-admin/post-new.php1,533 ▲1923.13 ▲5.55680.71 ▲42.9854.47 ▲1.43
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0798.25 ▼10.9445.71 ▲0.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_periodic_table_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/periodic-table-widget/widget/class.widget.periodic-table.php:20

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: chemistry, periodic-table-elements, widget, periodic-table, bxslider

periodic-table-widget/periodic-table-widget.php 92% from 13 tests

The main PHP script in "Periodic Table Widget" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 164 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected4,351 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JSON1002,425
JavaScript280491867
PHP9151408638
CSS11140352
PO File1182257
SVG10012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.43
▷ Minimum class complexity1.00
▷ Maximum class complexity64.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2586.21%
▷ Protected methods00.00%
▷ Private methods413.79%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG files were detected