77% wp-politic

Code Review | HT Politic – For Political WordPress Themes / Website

WordPress plugin HT Politic – For Political WordPress Themes / Website scored77%from 54 tests.

About plugin

  • Plugin page: wp-politic
  • Plugin version: 2.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2018
  • Latest release: Oct 17, 2023
  • Number of updates: 59
  • Update frequency: every 30.4 days
  • Top authors: devitemsllc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /12,897 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.69MB] [CPU: ▲1.11ms] 75% from 4 tests

This is a short check of server-side resources used by HT Politic – For Political WordPress Themes / Website
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,487.46ms on /wp-admin/admin.php?page=htpolitic-recommendations)
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6752.18 ▲13.98
Dashboard /wp-admin4.08 ▲0.7356.18 ▼5.57
Posts /wp-admin/edit.php4.13 ▲0.7749.93 ▼0.10
Add New Post /wp-admin/post-new.php6.57 ▲0.6992.96 ▲3.22
Media Library /wp-admin/upload.php3.91 ▲0.6939.35 ▲6.88
Campaigns /wp-admin/edit.php?post_type=wpcampaign4.0544.25
Portfolio /wp-admin/edit.php?post_type=wppolitic_portfolio4.0540.42
Recommendations /wp-admin/admin.php?page=htpolitic-recommendations8.381,487.46
Gallery /wp-admin/edit.php?post_type=wppolitic_gallery4.0545.12
Mission /wp-admin/edit.php?post_type=wppolitic_mission4.0540.50
Settings /wp-admin/admin.php?page=wppolitic_options3.9138.10
Team /wp-admin/edit.php?post_type=wppolitic_team4.0541.22

Server storage [IO: ▲4.66MB] [DB: ▲0.67MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 107 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
wppolitic_settings
wppolitic_post_types_settings
wppolitic_pro_themes
widget_recent-comments
wppolitic_portfilio_settings
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for HT Politic – For Political WordPress Themes / Website
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,223 ▲47715.87 ▲1.5220.85 ▲19.2549.30 ▲9.37
Dashboard /wp-admin2,431 ▲2506.33 ▲0.59105.91 ▲6.2637.86 ▼3.77
Posts /wp-admin/edit.php2,367 ▲2643.53 ▲1.5057.14 ▲16.0339.52 ▼0.14
Add New Post /wp-admin/post-new.php1,457 ▼7117.31 ▼5.86487.32 ▼160.9169.68 ▲21.37
Media Library /wp-admin/upload.php1,507 ▲1044.32 ▲0.1679.56 ▼16.8344.50 ▲0.85
Campaigns /wp-admin/edit.php?post_type=wpcampaign1,3553.4750.5633.99
Portfolio /wp-admin/edit.php?post_type=wppolitic_portfolio1,3433.5648.7933.97
Recommendations /wp-admin/admin.php?page=htpolitic-recommendations3,1553.4546.6995.75
Gallery /wp-admin/edit.php?post_type=wppolitic_gallery1,3443.4549.6534.28
Mission /wp-admin/edit.php?post_type=wppolitic_mission1,3403.4851.2534.71
Settings /wp-admin/admin.php?page=wppolitic_options1,3573.4792.6532.79
Team /wp-admin/edit.php?post_type=wppolitic_team1,3323.4751.9432.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • wppolitic_pro_themes
    • db_upgraded
    • wppolitic_post_types_settings
    • widget_recent-comments
    • wppolitic_settings
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wppolitic_portfilio_settings

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wppolitic_team
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(WPPOLITIC_ADDONS_PL_PATHadmin/admin-init.php): failed to open stream: No such file or directory in wp-content/plugins/wp-politic/admin/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-politic/includes/single-wppolitic_team.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-politic/includes/archive-wpcampaign.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Icons_Manager' not found in wp-content/plugins/wp-politic/includes/class.wppolitic-icon-manager.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-politic/includes/single-wppolitic_portfolio.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'WPPOLITIC_ADDONS_PL_PATHadmin/admin-init.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-politic/admin/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-politic/admin/admin-init.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-politic/includes/single-wppolitic_gallery.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-politic/includes/single-wppolitic_mission.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-politic/admin/wppolitic_custom-post-type.php:368

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 Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: event, campaign, advisor, candidate, political

wp-politic/wppolitic.php 85% from 13 tests

The entry point to "HT Politic – For Political WordPress Themes / Website" version 2.4.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-politic.php" instead of "wppolitic.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin26,460 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP351,64856916,344
CSS91,2861197,224
SVG1002,671
JavaScript2056149186
YAML22035

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity27.05
▷ Minimum class complexity2.00
▷ Maximum class complexity73.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods156
▷ Static methods42.56%
▷ Public methods12076.92%
▷ Protected methods3421.79%
▷ Private methods21.28%
Functions39
▷ Named functions3794.87%
▷ Anonymous functions25.13%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
30 PNG files occupy 1.76MB with 0.87MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/assets/images/extensions/ht-google-place-review.png2.64KB0.00KB▼ 100.00%
.wordpress-org/screenshot-7.png132.34KB141.91KB0.00%
(invalid) admin/assets/images/extensions/was-this-helpful.png1.21KB0.00KB▼ 100.00%
.wordpress-org/icon-128x128.png1.29KB0.70KB▼ 45.88%
.wordpress-org/screenshot-2.png91.52KB99.33KB0.00%