10% w2pe-measurement-widget

Code Review | w2pe Measurement Widget

WordPress plugin w2pe Measurement Widget scored10%from 54 tests.

About plugin

  • Plugin page: w2pe-measurement-...
  • Plugin version: 1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 12, 2014
  • Latest release: Mar 12, 2014
  • Number of updates: 16
  • Update frequency: N/A
  • Top authors: wppluginexpert (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /1,498 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/w2pe-measurement-widget/index.php+46
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/w2pe-measurement-widget/index.php:46
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): w2pe_measure_widget_table()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.70ms] Passed 4 tests

An overview of server-side resources used by w2pe Measurement Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.16 ▼4.30
Dashboard /wp-admin3.31 ▲0.0045.94 ▲0.61
Posts /wp-admin/edit.php3.36 ▲0.0045.70 ▼6.66
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.13 ▼18.81
Media Library /wp-admin/upload.php3.23 ▲0.0035.28 ▼1.03

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 16 new files
Database: 1 new table, 6 new options
New tables
wp_w2pe_measure_units
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

w2pe Measurement Widget: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.131.60 ▼0.1843.38 ▲3.82
Dashboard /wp-admin2,203 ▲184.86 ▼1.0198.23 ▼5.0538.33 ▼1.30
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0736.26 ▼5.3730.34 ▼5.88
Add New Post /wp-admin/post-new.php1,542 ▲2318.34 ▼4.75651.89 ▲1.9257.03 ▼13.61
Media Library /wp-admin/upload.php1,391 ▲64.20 ▼0.1198.03 ▼14.2441.60 ▼4.70

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/w2pe-measurement-widget/support.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/w2pe-measurement-widget/category.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/w2pe-measurement-widget/widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/w2pe-measurement-widget/page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/w2pe-measurement-widget/units.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/w2pe-measurement-widget/index.php:19

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: typography and digital image converter, measure, distance converter, unit conversion, temperature converter...

w2pe-measurement-widget/index.php 85% from 13 tests

The main file in "w2pe Measurement Widget" v. 1.00 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 186 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("w2pe-measurement-widget.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin814 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP611246666
CSS24779
JavaScript136369

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/edit.png0.34KB0.39KB0.00%
images/delete.png0.27KB0.37KB0.00%
images/menu.png1.00KB0.22KB▼ 78.40%