10% we-the-people

Code Review | We The People

WordPress plugin We The People scored10%from 54 tests.

About plugin

  • Plugin page: we-the-people
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.1
  • WordPress version: 6.3.1
  • First release: Jun 1, 2013
  • Latest release: Jan 25, 2015
  • Number of updates: 9
  • Update frequency: every 67.5 days
  • Top authors: stevegrunwell (66.67%)BuckeyeInteractive (44.44%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,938 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Compile error in wp-content/plugins/we-the-people/inc/template-tags.php+27
    Cannot use "self" when no class scope is active

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

A check of server-side resources used by We The People
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.62 ▼1.24
Dashboard /wp-admin3.31 ▲0.0046.58 ▼6.76
Posts /wp-admin/edit.php3.36 ▲0.0047.82 ▲1.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.87 ▼0.78
Media Library /wp-admin/upload.php3.23 ▲0.0036.09 ▼0.15

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

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

Browser metrics Passed 4 tests

We The People: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.204.57 ▲2.6744.05 ▼3.39
Dashboard /wp-admin2,206 ▲185.86 ▲0.98111.63 ▼2.6147.02 ▲0.79
Posts /wp-admin/edit.php2,086 ▼32.01 ▼0.0333.60 ▼2.2635.18 ▼3.00
Add New Post /wp-admin/post-new.php1,533 ▼923.80 ▲5.69672.10 ▲37.0948.20 ▼5.45
Media Library /wp-admin/upload.php1,391 ▼04.22 ▲0.0198.38 ▼3.0344.09 ▼2.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: widget_args in wp-content/plugins/we-the-people/templates/wtp-petition-error.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/we-the-people/templates/wtp-petition.php:10
    • > PHP Fatal error
      Cannot use "self" when no class scope is active in wp-content/plugins/we-the-people/inc/template-tags.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/we-the-people/templates/wtp-petition-error.php:14
    • > PHP Fatal error
      Cannot use "self" when no class scope is active in wp-content/plugins/we-the-people/inc/template-tags.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_api_key() on null in wp-content/plugins/we-the-people/inc/tinymce-plugin.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/we-the-people/templates/wtp-signature-form.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/we-the-people/inc/widget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/we-the-people/templates/wtp-petition-widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: we the people, america, democracy, white house, government...

we-the-people/we-the-people.php Passed 13 tests

The entry point to "We The People" version 2.0 is a PHP file that has certain tags in its header comment area
52 characters long description:
Display White House petitions on your WordPress site

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
Good job! No executable or dangerous file extensions detected717 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP10161461708
CSS6006
JavaScript3003

PHP code Passed 2 tests

This is a very shot review of 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.33
Average class complexity20.75
▷ Minimum class complexity6.00
▷ Maximum class complexity61.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods2480.00%
▷ Protected methods620.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/insert-petition.png1.82KB1.58KB▼ 13.04%