Skip to content

Commit 4e48ef6

Browse files
authored
Lots of updates
1 parent 3f4b701 commit 4e48ef6

20 files changed

Lines changed: 326 additions & 293 deletions

.github/CODE_OF_CONDUCT.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity and orientation.
10+
11+
We pledge to act and interact in ways that contribute to an open, welcoming,
12+
diverse, inclusive, and healthy community.
13+
14+
## Our Standards
15+
16+
Examples of behavior that contributes to a positive environment for our community include:
17+
18+
* Demonstrating empathy and kindness toward other people
19+
* Being respectful of differing opinions, viewpoints, and experiences
20+
* Giving and gracefully accepting constructive feedback
21+
* Accepting responsibility and apologizing to those affected by our mistakes
22+
* Focusing on what is best for the overall community
23+
24+
Examples of unacceptable behavior include:
25+
26+
* The use of sexualized language or imagery, and sexual attention or advances
27+
* Trolling, insulting or derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information without explicit permission
30+
* Other conduct which could reasonably be considered inappropriate in a professional setting
31+
32+
## Enforcement Responsibilities
33+
34+
Project maintainers are responsible for clarifying and enforcing our standards of
35+
acceptable behavior and will take appropriate and fair corrective action in
36+
response to any behavior that they deem inappropriate, threatening, offensive,
37+
or harmful.
38+
39+
## Scope
40+
41+
This Code of Conduct applies within all community spaces, and also applies when
42+
an individual is officially representing the community in public spaces.
43+
44+
## Enforcement
45+
46+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
47+
reported to the project maintainers responsible for enforcement at
48+
49+
50+
Project maintainers will review and investigate all complaints, and will
51+
respond in a way that they deem appropriate to the circumstances.
52+
53+
## Attribution
54+
55+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
56+
version 2.1, available at
57+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

.github/CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing to EngineScript
2+
3+
Thank you for your interest in contributing to EngineScript! This document provides guidelines and information for contributors.
4+
5+
## Table of Contents
6+
- [Code of Conduct](#code-of-conduct)
7+
- [How Can I Contribute?](#how-can-i-contribute)
8+
- [Development Setup](#development-setup)
9+
- [Pull Request Process](#pull-request-process)
10+
- [Style Guidelines](#style-guidelines)
11+
12+
## Code of Conduct
13+
14+
This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
15+
16+
## How Can I Contribute?
17+
18+
### Reporting Bugs
19+
- Check if the bug has already been reported in [Issues](https://github.com/EngineScript/EngineScript/issues)
20+
- If not, create a new issue with a clear title and description
21+
- Include steps to reproduce, expected behavior, and actual behavior
22+
- Add relevant system information (OS, PHP version, etc.)
23+
24+
### Suggesting Enhancements
25+
- First, read the [documentation](README.md)
26+
- Check if the enhancement has been suggested in [Issues](https://github.com/EngineScript/EngineScript/issues)
27+
- Provide a clear and detailed explanation of the feature
28+
29+
### Pull Requests
30+
1. Fork the repository
31+
2. Create a new branch (`git checkout -b feature/your-feature`)
32+
3. Make your changes
33+
4. Run tests if available
34+
5. Commit your changes (`git commit -m 'Add some feature'`)
35+
6. Push to the branch (`git push origin feature/your-feature`)
36+
7. Create a Pull Request
37+
38+
## Development Setup
39+
40+
1. Set up a test environment:
41+
- Ubuntu 24.04 LTS server
42+
43+
## Pull Request Process
44+
45+
1. Update the README.md with details of changes if applicable
46+
2. Update the documentation if you're changing functionality
47+
3. Use semantic commit messages:
48+
- `feat:` for new features
49+
- `fix:` for bug fixes
50+
- `docs:` for documentation changes
51+
- `style:` for formatting changes
52+
- `refactor:` for code restructuring
53+
- `test:` for adding tests
54+
- `chore:` for maintenance tasks
55+
56+
## Style Guidelines
57+
58+
### Shell Scripts
59+
- Use 2 spaces for indentation
60+
- Add comments for complex logic
61+
- Use meaningful variable names
62+
- Always check return values
63+
- Use shellcheck for validation
64+
65+
### Configuration Files
66+
- Use proper indentation
67+
- Add comments for non-obvious settings
68+
- Keep related settings grouped together
69+
- Follow the existing format
70+
71+
### Documentation
72+
- Use clear, concise language
73+
- Include examples where appropriate
74+
- Keep formatting consistent
75+
- Update table of contents when needed
76+
77+
## Need Help?
78+
79+
Feel free to:
80+
- Check our [documentation](README.md)
81+
- Open an [issue](https://github.com/EngineScript/EngineScript/issues)
82+
- Join our discussions
83+
84+
## License
85+
86+
By contributing to EngineScript, you agree that your contributions will be licensed under the same terms as the project.

.github/FUNDING.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# These are supported funding model platforms
2+
3+
#patreon: # Replace with a single Patreon username
4+
5+
github: enginescript
6+
ko_fi: enginescript
7+
buy_me_a_coffee: enginescript
8+
liberapay: enginescript
9+
thanks_dev: gh/pdowney

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## A High-Performance WordPress Server Built on Ubuntu and Cloudflare
33
EngineScript automates the process of building a high-performance LEMP server. We've specifically built EngineScript with WordPress users in mind, so the install process will take you from a bare server all the way to a working WordPress installation with Nginx FastCGI cache enabled in about 30 minutes.
44

5-
EngineScript Release Stage: **Alpha**
5+
EngineScript Release Stage: **Beta**
66

77
## Requirements
88
EngineScript is meant to be run as the root user on a fresh VPS. Setup will remove existing Apache, Nginx, PHP, and MySQL installations. Things **will** break if you run this script on a VPS that has already been configured.
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/var/log/EngineScript/*.log {
1+
/var/log/EngineScript/*.log /var/log/EngineScript/*.txt {
22
monthly
33
missingok
44
rotate 6
@@ -8,6 +8,13 @@
88
create 0644 root root
99
sharedscripts
1010

11+
prerotate
12+
if [ "$1" = "/var/log/EngineScript/install-log.txt" ]; then
13+
# Skip rotation for install log
14+
exit 0
15+
fi
16+
endscript
17+
1118
postrotate
1219
endscript
13-
}
20+
}

config/var/www/wordpress/plugins/wp-optimizer-enginescript/wp-optimizer-enginescript.php

Lines changed: 71 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,135 +2,95 @@
22
/*
33
Plugin Name: WP Optimization (EngineScript)
44
Description: Optimizes WordPress by removing unnecessary features and scripts
5-
Version: 1.1.0
5+
Version: 1.2.0
66
Author: EngineScript
77
License: GPL v2 or later
88
*/
99

10-
// Define plugin constants
11-
define('WP_OPTIMIZATION_VERSION', '1.1.0');
12-
define('WP_OPTIMIZATION_FILE', __FILE__);
13-
define('WP_OPTIMIZATION_PATH', plugin_dir_path(__FILE__));
14-
1510
// Prevent direct access
1611
if (!defined('ABSPATH')) {
1712
exit('No direct script access allowed');
1813
}
1914

20-
class WP_Optimization {
21-
private static $instance = null;
22-
23-
/**
24-
* Get plugin instance
25-
*/
26-
public static function get_instance() {
27-
if (null === self::$instance) {
28-
self::$instance = new self();
29-
}
30-
return self::$instance;
31-
}
15+
/**
16+
* Disable the emoji's
17+
*/
18+
function disable_emojis() {
19+
remove_action('wp_head', 'print_emoji_detection_script', 7);
20+
remove_action('admin_print_scripts', 'print_emoji_detection_script');
21+
remove_action('wp_print_styles', 'print_emoji_styles');
22+
remove_action('admin_print_styles', 'print_emoji_styles');
23+
remove_filter('the_content_feed', 'wp_staticize_emoji');
24+
remove_filter('comment_text_rss', 'wp_staticize_emoji');
25+
remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
26+
add_filter('tiny_mce_plugins', 'disable_emojis_tinymce');
27+
add_filter('wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2);
28+
}
29+
add_action('init', 'disable_emojis');
3230

33-
/**
34-
* Private constructor to prevent direct creation
35-
*/
36-
private function __construct() {
37-
// Initialize plugin
38-
add_action('init', [$this, 'disable_emojis']);
39-
add_action('wp_default_scripts', [$this, 'remove_jquery_migrate']);
40-
add_filter('wp_enqueue_scripts', [$this, 'disable_classic_theme_styles'], 100);
41-
42-
// Remove header items
43-
remove_action('wp_head', 'wp_generator');
44-
remove_action('wp_head', 'wlwmanifest_link');
45-
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
46-
remove_action('wp_head', 'rest_output_link_wp_head');
47-
remove_action('wp_head', 'wp_oembed_add_discovery_links');
48-
remove_action('wp_head', 'rsd_link');
49-
50-
// Disable widget styles and Jetpack ads
51-
add_filter('show_recent_comments_widget_style', '__return_false', 99);
52-
53-
// Only add Jetpack filters if active
54-
if ($this->is_jetpack_active()) {
55-
add_filter('jetpack_just_in_time_msgs', '__return_false', 20);
56-
add_filter('jetpack_show_promotions', '__return_false', 20);
57-
add_filter('jetpack_blaze_enabled', '__return_false');
58-
}
31+
/**
32+
* Filter function used to remove the tinymce emoji plugin.
33+
*
34+
* @param array $plugins
35+
* @return array Difference betwen the two arrays
36+
*/
37+
function disable_emojis_tinymce($plugins) {
38+
if (is_array($plugins)) {
39+
return array_diff($plugins, array('wpemoji'));
5940
}
41+
return array();
42+
}
6043

61-
/**
62-
* Check if Jetpack is active
63-
*/
64-
private function is_jetpack_active() {
65-
return class_exists('Jetpack');
44+
/**
45+
* Remove emoji CDN hostname from DNS prefetching hints.
46+
*
47+
* @param array $urls URLs to print for resource hints.
48+
* @param string $relation_type The relation type the URLs are printed for.
49+
* @return array Difference betwen the two arrays.
50+
*/
51+
function disable_emojis_remove_dns_prefetch($urls, $relation_type) {
52+
if ('dns-prefetch' == $relation_type) {
53+
$emoji_svg_url = apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/');
54+
$urls = array_diff($urls, array($emoji_svg_url));
6655
}
56+
return $urls;
57+
}
6758

68-
/**
69-
* Disable the emoji's
70-
*/
71-
public function disable_emojis() {
72-
remove_action('wp_head', 'print_emoji_detection_script', 7);
73-
remove_action('admin_print_scripts', 'print_emoji_detection_script');
74-
remove_action('wp_print_styles', 'print_emoji_styles');
75-
remove_action('admin_print_styles', 'print_emoji_styles');
76-
remove_filter('the_content_feed', 'wp_staticize_emoji');
77-
remove_filter('comment_text_rss', 'wp_staticize_emoji');
78-
remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
79-
add_filter('tiny_mce_plugins', [$this, 'disable_emojis_tinymce']);
80-
add_filter('wp_resource_hints', [$this, 'disable_emojis_remove_dns_prefetch'], 10, 2);
59+
/**
60+
* Remove JQuery Migrate
61+
*/
62+
function remove_jquery_migrate($scripts) {
63+
if (!is_admin() && isset($scripts->registered['jquery'])) {
64+
$script = $scripts->registered['jquery'];
65+
if ($script->deps) {
66+
$script->deps = array_diff($script->deps, array('jquery-migrate'));
67+
}
8168
}
69+
}
70+
add_action('wp_default_scripts', 'remove_jquery_migrate');
8271

83-
/**
84-
* Filter function used to remove the tinymce emoji plugin.
85-
*
86-
* @param array $plugins
87-
* @return array Difference between the two arrays
88-
*/
89-
public function disable_emojis_tinymce($plugins) {
90-
return is_array($plugins) ? array_diff($plugins, ['wpemoji']) : [];
91-
}
72+
/**
73+
* Disable classic-themes css added in WP 6.1
74+
*/
75+
function disable_classic_theme_styles() {
76+
wp_deregister_style('classic-theme-styles');
77+
wp_dequeue_style('classic-theme-styles');
78+
}
79+
add_filter('wp_enqueue_scripts', 'disable_classic_theme_styles', 100);
9280

93-
/**
94-
* Remove emoji CDN hostname from DNS prefetching hints.
95-
*
96-
* @param array $urls URLs to print for resource hints.
97-
* @param string $relation_type The relation type the URLs are printed for.
98-
* @return array Difference between the two arrays.
99-
*/
100-
public function disable_emojis_remove_dns_prefetch($urls, $relation_type) {
101-
if ('dns-prefetch' == $relation_type) {
102-
$emoji_svg_url = apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/');
103-
$urls = array_diff($urls, [$emoji_svg_url]);
104-
}
105-
return $urls;
106-
}
81+
// Remove WordPress Version from Header
82+
remove_action('wp_head', 'wp_generator');
10783

108-
/**
109-
* Remove JQuery Migrate
110-
*/
111-
public function remove_jquery_migrate($scripts) {
112-
if (!is_admin() && isset($scripts->registered['jquery'])) {
113-
$script = $scripts->registered['jquery'];
114-
if ($script->deps) {
115-
$script->deps = array_diff($script->deps, ['jquery-migrate']);
116-
}
117-
}
118-
}
84+
// Remove Windows Live Writer Manifest
85+
remove_action('wp_head', 'wlwmanifest_link');
11986

120-
/**
121-
* Disable classic-themes css added in WP 6.1
122-
*/
123-
public function disable_classic_theme_styles() {
124-
wp_deregister_style('classic-theme-styles');
125-
wp_dequeue_style('classic-theme-styles');
126-
}
87+
// Remove WP Shortlink URLs
88+
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
12789

128-
// Prevent cloning
129-
private function __clone() {}
130-
131-
// Prevent unserialize
132-
private function __wakeup() {}
133-
}
90+
// Remove Recent Comments Widget CSS Styles
91+
add_filter('show_recent_comments_widget_style', '__return_false', 99);
13492

135-
// Initialize using singleton
136-
WP_Optimization::get_instance();
93+
// Remove Jetpack Advertisements
94+
add_filter('jetpack_just_in_time_msgs', '__return_false', 20);
95+
add_filter('jetpack_show_promotions', '__return_false', 20);
96+
add_filter('jetpack_blaze_enabled', '__return_false');

0 commit comments

Comments
 (0)