78% reactpress

Code Review | ReactPress - Create React App for Wordpress

WordPress plugin ReactPress - Create React App for Wordpress scored78%from 54 tests.

About plugin

  • Plugin page: reactpress
  • Plugin version: 3.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 9, 2021
  • Latest release: Apr 21, 2023
  • Number of updates: 37
  • Update frequency: every 21.7 days
  • Top authors: rockiger (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active /24,110 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.13ms] Passed 4 tests

A check of server-side resources used by ReactPress - Create React App for Wordpress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.53 ▲1.00
Dashboard /wp-admin3.34 ▲0.0357.77 ▲5.80
Posts /wp-admin/edit.php3.39 ▲0.0345.86 ▲1.19
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.39 ▼4.40
Media Library /wp-admin/upload.php3.26 ▲0.0336.26 ▲1.69

Server storage [IO: ▲2.68MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/reactpress/" and "wp-content/uploads/"
    • (new file) wp-content/reactpress/apps/.empty
Filesystem: 66 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
repr_apps
can_compress_scripts
repr_version
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by ReactPress - Create React App for Wordpress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲23313.57 ▼0.815.26 ▲3.3442.40 ▼1.62
Dashboard /wp-admin2,295 ▲1075.87 ▼0.01103.20 ▲1.9741.85 ▼1.51
Posts /wp-admin/edit.php2,174 ▲852.04 ▲0.0234.79 ▼3.8234.22 ▲0.32
Add New Post /wp-admin/post-new.php1,548 ▲3422.98 ▲5.48652.35 ▼48.8462.52 ▼1.07
Media Library /wp-admin/upload.php1,473 ▲824.23 ▲0.0796.57 ▼2.6442.69 ▼4.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • repr_apps
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • repr_version

Smoke tests 50% 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 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/reactpress/public/partials/reactpress-public-display.php
    • > /wp-content/plugins/reactpress/admin/partials/reactpress-admin-display.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/reactpress/tests/UtilsTest.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reactpress/templates/react-page-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_attachment_image_src() in wp-content/plugins/reactpress/templates/empty-react-page-template.php:145
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/reactpress/tests/ActivatorTest.php:12

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: developer, js, javascript, embed, react

reactpress/reactpress.php Passed 13 tests

The main PHP script in "ReactPress - Create React App for Wordpress" version 3.2.0 is automatically included on every request by WordPress
78 characters long description:
Easily create, build and deploy React apps into your existing WordPress sites.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,149 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP284121,2091,991
JSON40083
SVG52135
Bourne Shell11219
Markdown19012
JavaScript53336
HTML1102
CSS2051

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.18
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes211.76%
Methods113
▷ Static methods4943.36%
▷ Public methods10492.04%
▷ Protected methods21.77%
▷ Private methods76.19%
Functions20
▷ Named functions735.00%
▷ Anonymous functions1365.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/js/reactpress-admin/build/logo192.png5.22KB5.57KB0.00%
admin/js/reactpress-admin/build/logo512.png9.44KB10.35KB0.00%