78% primal-for-wp

Code Review | Primal for WordPress

WordPress plugin Primal for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: primal-for-wp
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.7.5
  • WordPress version: 6.3.1
  • First release: Jun 12, 2013
  • Latest release: Aug 10, 2017
  • Number of updates: 110
  • Update frequency: every 13.8 days
  • Top authors: mikerolfeprimal (77.27%)timmashinter (22.73%)scottsmithprimal (1.82%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,086 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.12MB] [CPU: ▼12.90ms] Passed 4 tests

An overview of server-side resources used by Primal for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0650.03 ▲9.11
Dashboard /wp-admin3.25 ▼0.0633.18 ▼15.01
Posts /wp-admin/edit.php3.32 ▼0.0439.27 ▼8.49
Add New Post /wp-admin/post-new.php5.49 ▼0.4069.87 ▼27.17
Media Library /wp-admin/upload.php3.26 ▲0.0232.02 ▼0.93
Primal /wp-admin/options-general.php?page=primal_settings3.2329.80

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
primal_plugin_version
widget_recent-comments
widget_primal_widget

Browser metrics Passed 4 tests

Checking browser requirements for Primal for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲18113.65 ▼0.716.93 ▲5.1336.56 ▼9.76
Dashboard /wp-admin2,204 ▲165.83 ▼0.07103.71 ▼0.9838.06 ▼4.86
Posts /wp-admin/edit.php2,090 ▲41.99 ▼0.0536.40 ▼0.6735.39 ▲0.33
Add New Post /wp-admin/post-new.php1,545 ▲1218.08 ▼5.07657.84 ▼31.9756.68 ▲3.62
Media Library /wp-admin/upload.php1,395 ▲44.18 ▲0.0299.27 ▲2.7541.56 ▼7.11
Primal /wp-admin/options-general.php?page=primal_settings8202.0524.9631.66

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
  • This plugin does not fully uninstall, leaving 8 options in the database
    • primal_plugin_version
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_primal_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=primal_settings
    • > Warning in wp-includes/functions.php+6691
    file_get_contents(http://wp.com/wp-content/plugins/primal-for-wp/primal.php): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/primal-for-wp/widget.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/primal-for-wp/config.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/primal-for-wp/config.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: related posts, content recommendations, primal, content discovery, related content...

primal-for-wp/primal.php 92% from 13 tests

The primary PHP file in "Primal for WordPress" version 2.0.5 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("primal-for-wp.php" instead of "primal.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin322 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP55396255
JavaScript1174659
CSS1108

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions18
▷ Named functions18100.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
There are no PNG files in this plugin