84% wpcomponent

Code Review | WP Component

WordPress plugin WP Component scored 84% from 54 tests.

About plugin

  • Plugin page: wpcomponent
  • Plugin version: 2.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.8.2
  • WordPress version: 6.3.1
  • First release: Jul 15, 2016
  • Latest release: Oct 30, 2017
  • Number of updates: 38
  • Update frequency: every 12.4 days
  • Top authors: david massiani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,346 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.30MB] [CPU: ▼4.00ms] Passed 4 tests

Server-side resources used by WP Component
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.30 ▲1.12
Dashboard /wp-admin3.71 ▲0.4146.36 ▼3.49
Posts /wp-admin/edit.php3.76 ▲0.4048.10 ▼2.43
Add New Post /wp-admin/post-new.php6.23 ▲0.3598.32 ▼3.61
Media Library /wp-admin/upload.php3.57 ▲0.3437.05 ▼6.47
WP Component /wp-admin/options-general.php?page=wpcomponent3.5447.20

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
wpcomponent_setting_enable_inside_the_content

Browser metrics Passed 4 tests

An overview of browser requirements for WP Component
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲11914.45 ▼0.191.64 ▼0.2641.90 ▲0.12
Dashboard /wp-admin2,275 ▲846.57 ▲1.68151.25 ▲46.7040.97 ▼2.51
Posts /wp-admin/edit.php2,174 ▲853.45 ▲1.4283.98 ▲43.8233.85 ▼1.58
Add New Post /wp-admin/post-new.php6,626 ▲5,08423.41 ▲5.31948.63 ▲276.8641.51 ▼13.75
Media Library /wp-admin/upload.php1,450 ▲655.48 ▲1.23116.89 ▲17.5842.21 ▼1.07
WP Component /wp-admin/options-general.php?page=wpcomponent1,0953.8377.3658.99

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_wpcomponent() in wp-content/plugins/wpcomponent/templates/inside-container/double-col.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_wpcomponent() in wp-content/plugins/wpcomponent/templates/outside-container/triple-col.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wpcomponent/index.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_wpcomponent() in wp-content/plugins/wpcomponent/templates/outside-container/double-col.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wpcomponent/core/inc/wpc_content.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_wpcomponent() in wp-content/plugins/wpcomponent/macro-template-example.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_wpcomponent() in wp-content/plugins/wpcomponent/templates/inside-container/triple-col.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: components, landing-page, component, template, visual composer...

wpcomponent/index.php 92% from 13 tests

This is the main PHP file of "WP Component" version 2.2.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpcomponent.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin3,346 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP191,1345072,299
JavaScript4344718928
PO File1313183
SVG30029
CSS1607

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity23.25
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods74
▷ Static methods56.76%
▷ Public methods74100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
front/images/damier.png0.09KB0.09KB0.00%
front/images/wpcomponent-icon-16.png0.11KB0.11KB0.00%