function hocwp_option_smtp_email_testing_message()
{
    $transient_name = hocwp_build_transient_name('hocwp_cache_test_smtp_result_%s', '');
    if (false !== ($message = get_transient($transient_name))) {
        hocwp_admin_notice(array('text' => $message));
        delete_transient($transient_name);
    }
    unset($message, $transient_name);
}
예제 #2
0
function hocwp_in_maintenance_mode_notice()
{
    if (hocwp_in_maintenance_mode()) {
        $page = hocwp_get_current_admin_page();
        if ('hocwp_maintenance' != $page) {
            $args = array('text' => sprintf(__('Your site is running in maintenance mode, so you can go to %s and turn it off when done.', 'hocwp-theme'), '<a href="' . admin_url('tools.php?page=hocwp_maintenance') . '">' . __('setting page', 'hocwp-theme') . '</a>'));
            hocwp_admin_notice($args);
        }
    }
}
예제 #3
0
function hocwp_setup_warning_php_minimum_version()
{
    $transient_name = 'hocwp_warning_php_recommend_version_%s';
    $transient_name = hocwp_build_transient_name($transient_name, '');
    if (false === get_transient($transient_name)) {
        global $wp_version;
        $args = array('text' => sprintf(__('Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s. Please contact your hosting provider to upgrade it.', 'hocwp-theme'), PHP_VERSION, $wp_version, HOCWP_MINIMUM_PHP_VERSION), 'type' => 'warning', 'title' => __('Warning', 'hocwp-theme'));
        hocwp_admin_notice($args);
        set_transient($transient_name, 1, WEEK_IN_SECONDS);
    }
}
 public function invalid_license_notice()
 {
     $plugin_name = hocwp_get_plugin_name($this->file, $this->basename);
     $plugin_name = hocwp_wrap_tag($plugin_name, 'strong');
     $args = array('error' => true, 'title' => __('Error', 'hocwp-theme'), 'text' => sprintf(__('Plugin %1$s is using an invalid license key! If you does not have one, please contact %2$s via email address %3$s for more information.', 'hocwp-theme'), $plugin_name, '<strong>' . HOCWP_NAME . '</strong>', '<a href="mailto:' . esc_attr(HOCWP_EMAIL) . '">' . HOCWP_EMAIL . '</a>'));
     hocwp_admin_notice($args);
 }
function hocwp_setup_theme_admin_notice_required_plugins()
{
    $required_plugins = hocwp_get_theme_required_plugins();
    if (hocwp_array_has_value($required_plugins)) {
        $active_plugins = get_option('active_plugins');
        $missing_required = false;
        if (!hocwp_array_has_value($active_plugins)) {
            $missing_required = true;
        } else {
            $not_active = array();
            foreach ($required_plugins as $slug) {
                if ('woocommerce' == $slug && hocwp_wc_installed()) {
                    continue;
                }
                $install = false;
                foreach ($active_plugins as $basename) {
                    $tmp = basename(dirname($basename));
                    if ($tmp == $slug) {
                        $install = true;
                    }
                }
                if (!$install) {
                    $not_active[] = $slug;
                }
            }
            if (hocwp_array_has_value($not_active)) {
                $missing_required = true;
            }
        }
        if ($missing_required) {
            $admin_url = admin_url('admin.php');
            $admin_url = add_query_arg(array('page' => 'hocwp_recommended_plugin', 'tab' => 'required'), $admin_url);
            hocwp_admin_notice(array('text' => sprintf(__('Please install the required plugins for your theme. You can <a href="%s">click here</a> to see the list of required plugins for this theme.', 'hocwp-theme'), $admin_url), 'error' => true));
        }
    }
}
예제 #6
0
function hocwp_classifieds_admin_notice()
{
    $post_id = hocwp_get_method_value('post', 'request');
    if (hocwp_id_number_valid($post_id)) {
        $transient_name = hocwp_build_transient_name('hocwp_save_classifieds_post_%s_error', $post_id);
        $errors = get_transient($transient_name);
        if (false !== $errors) {
            foreach ($errors as $error) {
                hocwp_admin_notice(array('text' => $error, 'error' => true));
            }
            delete_transient($transient_name);
        }
    }
}
예제 #7
0
function hocwp_admin_notice_setting_saved()
{
    hocwp_admin_notice(array('text' => '<strong>' . __('Settings saved.', 'hocwp-theme') . '</strong>'));
}
예제 #8
0
function hocwp_setup_theme_invalid_license_message()
{
    delete_transient('hocwp_invalid_theme_license');
    $args = array('error' => true, 'title' => __('Error', 'hocwp-theme'), 'text' => sprintf(__('Your theme is using an invalid license key! If you does not have one, please contact %1$s via email address %2$s for more information.', 'hocwp-theme'), '<strong>' . HOCWP_NAME . '</strong>', '<a href="mailto:' . esc_attr(HOCWP_EMAIL) . '">' . HOCWP_EMAIL . '</a>'));
    hocwp_admin_notice($args);
    $theme = wp_get_theme();
    hocwp_send_mail_invalid_license($theme->get('Name'));
}