Skip to content

Commit

Permalink
Merge pull request #49 from oceanwp/oe-rc
Browse files Browse the repository at this point in the history
Oe rc
  • Loading branch information
eramits committed Nov 9, 2022
2 parents fb71215 + e1b6b74 commit 675b8a3
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 34 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
== Changelog ==

= 2.0.6 - NOV 9 2022 =
- NEW: Typography: Option to choose font format for local Google fonts feature (Customize > Typography > General).
- Fixed: Custom CSS: Custom Styling Location option doesn't store custom css.
- Updated: Plugin description.

= 2.0.5 =
- Fixed: Customizer Styling Import: Potential vulnerability patch: WPScan report #5596728.

Expand Down
3 changes: 2 additions & 1 deletion includes/admin-bar/admin-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function __construct() {
}

add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_css' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ) );
add_action( 'admin_bar_menu', array( $this, 'register' ), 999 );
}

Expand All @@ -43,7 +44,7 @@ public function has_access() {
* Add "Ocean" item to new-content admin bar menu item
*/
public function admin_bar( $wp_admin_bar ) {
if ( ! is_admin_bar_showing() || ! wpforms_current_user_can( 'create_forms' ) ) {
if ( ! is_admin_bar_showing() ) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions includes/admin-bar/assets/css/admin-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
.wp-ui-notification.ocean-menu-notification-counter,
.wp-ui-notification.ocean-menu-notification-indicator {
background-color: #19bbf1 !important;
color: #ffffff;
}

#wpadminbar .ocean-menu-notification-indicator:after {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin-bar/assets/css/admin-bar.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/admin-bar/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function check_dates( $notifications ) {
public function get() {
$option = $this->get_option();

if (empty($option['update']) || time() > $option['update'] + DAY_IN_SECONDS) {
if ( empty( $option['update'] ) || time() > $option['update'] + DAY_IN_SECONDS ) {
if ( ! wp_next_scheduled( 'ocean_admin_notifications_update' ) ) {
wp_schedule_single_event( time() + 60, 'ocean_admin_notifications_update' );
}
Expand Down
36 changes: 26 additions & 10 deletions includes/compatibility/ocean.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,28 @@ function ocean_get_google_font_css( $url ) {
if ( strpos( $url, 'https:' ) === false && strpos( $url, 'http:' ) === false ) {
$url = 'https:' . $url;
}

$font_format = get_theme_mod( 'ocean_local_google_font_format', 'ttf' );
switch ( $font_format ) {
case 'ttf':
$user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; et; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9';
break;
case 'woff':
$user_agent = 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0';
break;
case 'woff2':
$user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36';
break;
default:
$user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; et; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9';
break;
}

$request = wp_safe_remote_get(
$url,
array(
'sslverify' => false,
'user-agent' => $user_agent,
)
);
if ( is_wp_error( $request ) ) {
Expand Down Expand Up @@ -242,7 +260,6 @@ function oceanwp_webfonts_local_font_url( $url ) {
// Setup theme => Generate the custom CSS file.
add_action( 'admin_bar_init', 'ocean_save_customizer_css_in_file', 9999 );
if ( ! function_exists( 'ocean_save_customizer_css_in_file' ) ) {

function ocean_save_customizer_css_in_file( $output = null ) {

// If Custom File is not selected.
Expand All @@ -259,17 +276,16 @@ function ocean_save_customizer_css_in_file( $output = null ) {
// Minified the Custom CSS.
$output .= oceanwp_minify_css( $output_custom_css );

// We will probably need to load this file.
require_once ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'file.php';

$upload_dir = wp_upload_dir(); // Grab uploads folder array.
$dir = trailingslashit( $upload_dir['basedir'] ) . 'oceanwp' . DIRECTORY_SEPARATOR; // Set storage directory path.

if ( ! file_exists( untrailingslashit( $dir ) ) ) {
if ( mkdir( untrailingslashit( $dir ), FS_CHMOD_DIR ) ) {
if ( file_put_contents( $dir . 'custom-style.css', $output ) ) {
chmod( $filename, 0644 );
}
$untraling_dir = untrailingslashit( $dir );
if ( ! file_exists( $untraling_dir ) ) {
mkdir( $untraling_dir, FS_CHMOD_DIR );
}
if( file_exists( $untraling_dir ) ) {
$filename = $dir . 'custom-style.css';
if ( file_put_contents( $filename, $output ) ) {
chmod( $filename, 0644 );
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions includes/panel/demos.php
Original file line number Diff line number Diff line change
Expand Up @@ -1007,14 +1007,14 @@ public static function ajax_demo_data() {

<p><?php echo
sprintf(
esc_html__( 'Importing demo data allow you to quickly edit everything instead of creating content from scratch. It is recommended uploading sample data on a fresh WordPress install to prevent conflicts with your current content. You can use this plugin to reset your site if needed: %1$sWordpress Database Reset%2$s.', 'ocean-extra' ),
esc_html__( 'Importing a demo template allows you to kick-start your website fast, instead of creating content from scratch. It is recommended to upload a demo template on a fresh WordPress install to prevent conflict with your current content or content loss. You can use this plugin to reset your site if needed: %1$sWordpress Database Reset%2$s.', 'ocean-extra' ),
'<a href="'. $plugin_link .'" target="_blank">',
'</a>'
); ?></p>

<div class="owp-required-plugins-wrap">
<h3><?php esc_html_e( 'Required Plugins', 'ocean-extra' ); ?></h3>
<p><?php esc_html_e( 'For your site to look exactly like this demo, the plugins below need to be activated.', 'ocean-extra' ); ?></p>
<p><?php esc_html_e( 'For your site to look exactly like this demo, we recommend the plugins below to be installed and activated.', 'ocean-extra' ); ?></p>
<div class="owp-required-plugins oe-plugin-installer">
<?php
self::required_plugins( $free, 'free' );
Expand Down
4 changes: 2 additions & 2 deletions includes/wizard/classes/WizardAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function ajax_demo_data() {
<p><?php
echo
sprintf(
esc_html__('Importing demo data allow you to quickly edit everything instead of creating content from scratch. It is recommended uploading sample data on a fresh WordPress install to prevent conflicts with your current content. You can use this plugin to reset your site if needed: %1$sWordpress Database Reset%2$s.', 'ocean-extra'), '<a href="' . $plugin_link . '" target="_blank">', '</a>'
esc_html__('Importing a demo template allows you to kick-start your website fast, instead of creating content from scratch. It is recommended to upload a demo template on a fresh WordPress install to prevent conflict with your current content or content loss. You can use this plugin to reset your site if needed: %1$sWordpress Database Reset%2$s.', 'ocean-extra'), '<a href="' . $plugin_link . '" target="_blank">', '</a>'
);
?></p>

<div class="owp-required-plugins-wrap">
<h3><?php esc_html_e('Required Plugins', 'ocean-extra'); ?></h3>
<p><?php esc_html_e('For your site to look exactly like this demo, the plugins below need to be activated.', 'ocean-extra'); ?></p>
<p><?php esc_html_e('For your site to look exactly like this demo, we recommend the plugins below to be installed and activated.', 'ocean-extra'); ?></p>
<div class="owp-required-plugins oe-plugin-installer">
<?php
OceanWP_Demos::required_plugins($free, 'free');
Expand Down
14 changes: 7 additions & 7 deletions ocean-extra.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/**
* Plugin Name: Ocean Extra
* Plugin URI: https://oceanwp.org/extension/ocean-extra/
* Description: Add extra features like widgets, metaboxes, import/export and a panel to activate the premium extensions.
* Version: 2.0.5
* Description: Add extra features and flexibility to your OceanWP theme for a turbocharged premium experience and full control over every aspect of your website.
* Version: 2.0.6
* Author: OceanWP
* Author URI: https://oceanwp.org/
* Requires at least: 5.6
* Tested up to: 6.0.2
* Tested up to: 6.1
* Text Domain: ocean-extra
* Domain Path: /languages
*
Expand Down Expand Up @@ -90,7 +90,7 @@ public function __construct( $widget_areas = array() ) {
$this->token = 'ocean-extra';
$this->plugin_url = plugin_dir_url( __FILE__ );
$this->plugin_path = plugin_dir_path( __FILE__ );
$this->version = '2.0.5';
$this->version = '2.0.6';

define( 'OE_URL', $this->plugin_url );
define( 'OE_PATH', $this->plugin_path );
Expand All @@ -113,13 +113,13 @@ public function __construct( $widget_areas = array() ) {

// Menu icons
$theme = wp_get_theme();
if ( 'OceanWP' == $theme->name || 'oceanwp' == $theme->template ) {
if ( 'OceanWP' == $theme->name || 'oceanwp' == $theme->template ) {

if ( get_template_directory() == get_stylesheet_directory() ) {
$current_theme_version = theme_version();
} else {
$parent = wp_get_theme()->parent();
// get parent version
$parent = wp_get_theme()->parent();
// get parent version
if ( ! empty( $parent) ) {
$current_theme_version = $parent->Version;
}
Expand Down
Loading

0 comments on commit 675b8a3

Please sign in to comment.