83% sr-piechirt-wp

Code Review | sr-piechart-wp

WordPress plugin sr-piechart-wp scored83%from 54 tests.

About plugin

  • Plugin page: sr-piechirt-wp
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Nov 21, 2014
  • Latest release: Nov 21, 2014
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: sohel razzaque (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,192 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.82ms] Passed 4 tests

An overview of server-side resources used by sr-piechart-wp
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0226.42 ▼17.62
Dashboard /wp-admin3.38 ▲0.0749.19 ▼5.16
Posts /wp-admin/edit.php3.43 ▲0.0749.87 ▲7.42
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.59 ▼4.36
Media Library /wp-admin/upload.php3.30 ▲0.0736.13 ▲3.85
Add New /wp-admin/post-new.php?post_type=pie_chart3.4452.20
pie settings /wp-admin/edit.php?post_type=pie_chart&page=piechart-settings3.2733.05
pie_charts /wp-admin/edit.php?post_type=pie_chart3.3434.88
pie chart category /wp-admin/edit-tags.php?taxonomy=pie_chart_cat&post_type=pie_chart3.2934.32

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

sr-piechart-wp: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲23314.17 ▼0.235.72 ▲3.6139.29 ▼8.28
Dashboard /wp-admin2,263 ▲755.11 ▲0.22111.99 ▲3.9339.43 ▼3.91
Posts /wp-admin/edit.php2,148 ▲592.32 ▲0.2741.24 ▲0.9035.53 ▼1.30
Add New Post /wp-admin/post-new.php1,565 ▲3118.84 ▼4.23631.22 ▼73.7733.56 ▼19.75
Media Library /wp-admin/upload.php1,445 ▲574.50 ▲0.29100.92 ▲0.0245.00 ▲1.51
Add New /wp-admin/post-new.php?post_type=pie_chart2,4377.93188.3072.59
pie settings /wp-admin/edit.php?post_type=pie_chart&page=piechart-settings1,2472.5851.1127.06
pie_charts /wp-admin/edit.php?post_type=pie_chart1,1262.2533.8627.44
pie chart category /wp-admin/edit-tags.php?taxonomy=pie_chart_cat&post_type=pie_chart1,3211.9832.0729.01

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sr-piechirt-wp/sr-piechirt-wp.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
Please take inspiration from this readme.txt

sr-piechirt-wp/sr-piechirt-wp.php 92% from 13 tests

"sr-piechart-wp" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 434 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
No dangerous file extensions were detected454 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript34718232
PHP115336202
CSS13020

PHP code Passed 2 tests

An short overview of 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.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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.69MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png94.03KB30.11KB▼ 67.98%
screenshot-1.png188.97KB58.24KB▼ 69.18%
screenshot-5.png76.01KB36.50KB▼ 51.98%
screenshot-4.png172.73KB53.15KB▼ 69.23%
screenshot-3.png95.70KB29.24KB▼ 69.44%