78% presscode

Code Review | PressCode

WordPress plugin PressCode scored78%from 54 tests.

About plugin

  • Plugin page: presscode
  • Plugin version: 1.0.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8
  • WordPress version: 6.3.1
  • First release: Jan 4, 2017
  • Latest release: Nov 6, 2017
  • Number of updates: 14
  • Update frequency: every 21.7 days
  • Top authors: jasondalycan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,012 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲2.17MB] [CPU: ▲5.58ms] Passed 4 tests

An overview of server-side resources used by PressCode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.52 ▲2.0550.98 ▲8.01
Dashboard /wp-admin5.52 ▲2.1758.86 ▼7.71
Posts /wp-admin/edit.php5.66 ▲2.3065.95 ▲10.80
Add New Post /wp-admin/post-new.php8.15 ▲2.26110.34 ▲11.23
Media Library /wp-admin/upload.php5.44 ▲2.2160.11 ▲21.42
Settings /wp-admin/admin.php?page=pcode_settings9.5876.09
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins5.6547.02
Dashboard /wp-admin/admin.php?page=pcode_dashboard7.8557.29

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 229 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
PcodeApfPageSettings
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by PressCode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10514.14 ▼0.491.62 ▼0.1540.82 ▼4.22
Dashboard /wp-admin2,275 ▲1045.59 ▼0.1089.37 ▼4.7647.01 ▲3.55
Posts /wp-admin/edit.php2,186 ▲862.04 ▲0.0241.16 ▲1.2542.01 ▲1.99
Add New Post /wp-admin/post-new.php1,592 ▲6621.10 ▼1.98616.06 ▼94.5755.81 ▲1.78
Media Library /wp-admin/upload.php1,485 ▲854.28 ▲0.04101.73 ▼6.5947.47 ▲4.45
Settings /wp-admin/admin.php?page=pcode_settings1,0802.2434.7970.72
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins1,0602.0625.4931.85
Dashboard /wp-admin/admin.php?page=pcode_dashboard9332.2327.9542.32

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • PcodeApfPageSettings
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following
  • 208× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_HelpPane_Base' not found in wp-content/plugins/presscode/lib/apf/factory/page_meta_box/_controller/AdminPageFramework_HelpPane_page_meta_box.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/presscode/lib/apf/factory/_common/form/_view/resource/AdminPageFramework_Form_View__Resource.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Form_View___Attribute_Base' not found in wp-content/plugins/presscode/lib/apf/factory/_common/form/_view/attribute/AdminPageFramework_Form_View___Attribute_SectionsTablesContainer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Registry' not found in wp-content/plugins/presscode/lib/apf/admin-page-framework-include-class-list.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Form_View___Section_Base' not found in wp-content/plugins/presscode/lib/apf/factory/_common/form/_view/AdminPageFramework_Form_View___ToolTip.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/presscode/lib/apf/factory/_common/form/AdminPageFramework_Form.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Form_View___Section_Base' not found in wp-content/plugins/presscode/lib/apf/factory/_common/form/_view/sectionset/AdminPageFramework_Form_View___Sectionsets.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Link_Base' not found in wp-content/plugins/presscode/lib/apf/factory/post_type/_controller/AdminPageFramework_Link_post_type.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Factory' not found in wp-content/plugins/presscode/lib/apf/factory/user_meta/AdminPageFramework_UserMeta.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pcode_AdminPageFramework_Input_Base' not found in wp-content/plugins/presscode/lib/apf/factory/_common/form/input/AdminPageFramework_Input_radio.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pcode_dashboard
    • > Javascript (severe) in unknown
    /wp-content/plugins/presscode/js/presscode-codemirror-5.13-mode-clike.js?ver=6.3.1 9:8 Uncaught ReferenceError: CodeMirror is not defined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pcode_dashboard
    • > Javascript (severe) in unknown
    /wp-content/plugins/presscode/js/presscode-codemirror-5.13-mode-php.js?ver=6.3.1 9:8 Uncaught ReferenceError: CodeMirror is not defined

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === presscode === )
The official readme.txt might help

presscode/presscode.php Passed 13 tests

The primary PHP file in "PressCode" version 1.0.13 is used by WordPress to initiate all plugin functionality
67 characters long description:
The best and easiest way to add custom code to your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected18,904 lines of code in 225 files:
LanguageFilesBlank linesComment linesLines of code
PHP2231,2583,28118,108
JavaScript267152796

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.75
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes335
▷ Abstract classes9327.76%
▷ Concrete classes24272.24%
▷ Final classes20.83%
Methods1,764
▷ Static methods24613.95%
▷ Public methods1,01357.43%
▷ Protected methods28416.10%
▷ Private methods46726.47%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants00.00%
▷ Class constants15100.00%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/presscode-logo-256.png6.30KB3.73KB▼ 40.69%
images/presscode-logo-128.png7.78KB2.43KB▼ 68.75%