73% activist

Code Review | Activist

WordPress plugin Activist scored 73% from 54 tests.

About plugin

  • Plugin page: activist
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 5.9.2
  • First release: Nov 23, 2015
  • Latest release: Dec 22, 2015
  • Number of updates: 3
  • Update frequency: every 10.7 days
  • Top authors: willscott (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.20MB] [CPU: ▼297.58ms] Passed 4 tests

An overview of server-side resources used by Activist
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▼0.0056.60 ▲4.42
Dashboard /wp-admin3.48 ▲0.0833.92 ▼0.62
Posts /wp-admin/edit.php3.71 ▲0.0738.71 ▼0.10
Add New Post /wp-admin/post-new.php6.13 ▼0.8775.98 ▼1,186.09
Media Library /wp-admin/upload.php3.31 ▲0.0221.34 ▼3.49
Activist /wp-admin/options-general.php?page=activist-config3.3523.87

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Activist
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,665 ▼1,0574.95 ▼10.693.70 ▼3.0329.64 ▲27.30
Dashboard /wp-admin2,413 ▼4482.33 ▼3.8649.56 ▼84.91169.44 ▲7.47
Posts /wp-admin/edit.php2,576 ▼1152.32 ▼0.9242.15 ▼24.19141.26 ▼4.69
Add New Post /wp-admin/post-new.php77 ▼1,5830.94 ▼14.620.22 ▼425.8047.55 ▼98.77
Media Library /wp-admin/upload.php89 ▼1,6091.50 ▼4.0532.39 ▼112.4547.53 ▼140.69
Activist /wp-admin/options-general.php?page=activist-config1,2182.2638.82139.74

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=activist-config
    • > Error in wp-content/plugins/activist/includes/activist.class.php+66
    Uncaught ArgumentCountError: Too few arguments to function Activist::defer_script(), 1 passed in wp-includes/class-wp-hook.php on line 309 and exactly 2 expected in wp-content/plugins/activist/includes/activist.class.php:66
    Stack trace:
    #0 wp-includes/class-wp-hook.php(309): Activist::defer_script()
    #1 wp-includes/plugin.php(189): WP_Hook->apply_filters()
    #2 wp-includes/class.wp-scripts.php(400): apply_filters()
    #3 wp-includes/class.wp-dependencies.php(136): WP_Scripts->do_item()
    #4 wp-includes/class.wp-scripts.php(674): WP_Dependencies->do_items()
    #5 wp-includes/script-loader.php(1979): WP_Scripts->do_footer_items()
    #6 wp-includes/script-loader.php(2074): print_footer_scripts()
    #7 wp-includes/class-wp-hook.php(307): _wp_footer_scripts()
    #8 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #9

SRP 0% 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/activist/views/offline.php
    • > /wp-content/plugins/activist/views/frame.php
    • > /wp-content/plugins/activist/activist.php
    • > /wp-content/plugins/activist/views/warning.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/activist/views/config.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 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
4 plugin tags: caching, censorship, access, block

activist/activist.php Passed 13 tests

"Activist" version 0.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
47 characters long description:
Activate your users against network disruptions

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected492 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP87150454
Markdown16018
JavaScript12111
HTML1009

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity20.50
▷ Minimum class complexity15.00
▷ Maximum class complexity26.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27100.00%
▷ Public methods1866.67%
▷ Protected methods00.00%
▷ Private methods933.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png57.25KB15.10KB▼ 73.63%