Forum Replies Created

Viewing 15 replies - 1 through 15 (of 95 total)
  • Thread Starter TIEro

    (@tiero)

    Solved it myself. cPanel support couldn’t find anything wrong, I couldn’t find anything wrong, no reply from Optimizer. Restored an UpdraftPlus backup of the themes directory and it all started working again. Just one of those things, I guess.

    Thread Starter TIEro

    (@tiero)

    Update: it’s not any other plugin (deactivated them all, still happens) and it’s just Optimizer (no other theme has disappearing files).

    Thread Starter TIEro

    (@tiero)

    (Closing)

    Thread Starter TIEro

    (@tiero)

    That appears to have done it, thanks.

    You know, you may be better off storing a relative path and having WP add the base URL to the front of it, so that an http-to-https change (or domain change or whatever) wouldn’t affect it. 🙂

    Thread Starter TIEro

    (@tiero)

    Pretty much everything everyone reported in the beta (and since) that should have made WP realise that it was a godawful idea.

    And yeah, been using the classic editor plugin on every site since Gutencrap went live. Says it all, really, that the classic plugin gets great ratings and endless downloads compared to the new thing with 1 star and everyone avoiding it.

    Thread Starter TIEro

    (@tiero)

    It would’ve helped a week ago when the problem happened. I rebuilt from my testbed installation, though I lost some changes in the process.

    Where’s the old data stored in the database? I’ll find it manually and fix it that way. 🙂

    Thread Starter TIEro

    (@tiero)

    Apologies for the delay in replying: WP never sends me updates, even though I have the option marked.

    Your solution would mean editing the style.css of the theme – changes which would be lost when it’s updated.

    Is there a replacement I can use in “Additional CSS” or in a child theme style.css to negate the first para settings instead? That’ll be a better solution.

    Thanks!

    Thread Starter TIEro

    (@tiero)

    Additional: blog posts which have a manually created “more” tag in them don’t work with this widget. The “Continue Reading” option disappears when they’re displayed.

    • This reply was modified 8 years, 7 months ago by TIEro.
    • This reply was modified 8 years, 7 months ago by TIEro.
    Thread Starter TIEro

    (@tiero)

    Aha! Of course… because it runs the session bit at the start of each page load, so it checks the URL *again* and finds no “?ref=”, so assigns zero. It’s all so obvious once someone smart points it out. Thank you VERY much.

    For reference, added a “!isset” check to the session function as follows:

    function was_start_session() {
    
    	// Check for an active session: if there is none, start one. 
    	if (session_status() == PHP_SESSION_NONE) {
    		session_start();
    	}
    
    	// Check for referrer and store in session.
    	// If there is no referrer, assign to user zero.
    	if (!isset($_SESSION['ref'])) {
    		$_SESSION['ref'] = (isset($_GET['ref'])) ? $_GET['ref'] : 0;
    	}
    }

    Tested and working. Resolved. Thanks again!

    • This reply was modified 9 years, 1 month ago by TIEro.
    Thread Starter TIEro

    (@tiero)

    Update: tested on a clean install with only that plugin running and the basic Twenty[x]teen theme. Nope, still not working. 🙁

    Thread Starter TIEro

    (@tiero)

    Just looked at screenshots and answered my own question: no, it doesn’t trap all wp_mail.

    Ah, well. 🙂

    Thread Starter TIEro

    (@tiero)

    Hi,

    “So I should copy the file tinymce_4.5.1\tinymce\js\tinymce\plugins\wordcount\plugin.min.js
    and upload it to my folder: /httpdocs/wp-content/plugins/wp-voting-contest?”

    Yes, that’s what I did for my testing.

    I guess you could put the file anywhere but I figured including it as part of the plugin was best.

    For the final version of mine, I created a sub-folder in my plugin for TinyMCE stuff, in case I wanted to add more plugins, so mine ended up in /plugins/plugin-name/tinymce/plugins/wordcount – which is HORRIBLY ugly but probably best practice. If you only want to use one plugin, stuff it in the top folder. It’s easier. 🙂

    I put the filter code in my main plugin file, so probably wp-voting-contest.php or something. I don’t think it matters, really, as long as you put it in a file that’s included in your plugin. I put it in the main one because I wanted it to load right at the start.

    Hope that helps!

    • This reply was modified 9 years, 5 months ago by TIEro.
    • This reply was modified 9 years, 5 months ago by TIEro.
    Thread Starter TIEro

    (@tiero)

    Seriously. Over 20% of the world’s websites use WP, yet the dev resources are still incomplete, vague and for the most part unhelpful.

    Ah, well. 🙂

    Thread Starter TIEro

    (@tiero)

    Aaaand there it is. StackOverflow to the rescue, as usual:

    http://stackoverflow.com/questions/23896040/how-do-i-add-the-fullpage-tinymce-plugin-to-the-standard-tinymce-editor-in-wordp

    Went and grabbed the TinyMCE download, hunted through the files for the plugin I wanted (plugins/wordcount). There’s a single plugin.min.js file in there. Put that in my plugin folder (at the root, just for testing).

    Then added this code:

    // Add wordcount plugin to TinyMCE for all instances.
    add_filter('mce_external_plugins', 'aa_register_tinymce_plugins');
    function aa_register_tinymce_plugins() {
    	$plugins = array('wordcount'); //Add any more plugins you want to load here
    	$plugins_array = array();
    
    	//Build the response - the key is the plugin name, value is the URL to the plugin JS
    	foreach ($plugins as $plugin ) {
    		$plugins_array[$plugin] = plugins_url('plugin.min.js', __FILE__);
    	}
    	return $plugins_array;
    }

    And the word count appears. For multiple plugins, you’d put the whole of the tinymce download into your plugin folder and change the foreach line to look in the tinymce/plugins subdirs (each plugin has a plugin.min.js file):

    $plugins_array[ $plugin ] = plugins_url('tinymce/plugins/', __FILE__) . $plugin . '/plugin.min.js';

    Job done. Phew. 🙂

    Thread Starter TIEro

    (@tiero)

    Further research: there’s a filter for adding plugins to TinyMCE.

    https://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/mce_external_plugins

    Unfortunately (as usual), the Codex is completely unclear about any practical use of the thing, so I have no idea how to add “wordcount”. Searches online just bring back very complex code to add buttons or the simple code to limit buttons (like I’m already doing).

    This is a great example of why WP is brilliant and sucks: you can do anything with it, but you have to already know how to do it before you look up how to do it. :\

Viewing 15 replies - 1 through 15 (of 95 total)