Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gertjank

    (@gertjank)

    Update : (a small messy writeup)
    I removed the “old editor” (the extension) and re enabled the new one (“Gutenberg”).
    https://www.brit-hotel-fumel.fr/contact/#piscine
    still works well.

    But : as soon as I login, and edit/open the “contact” page, or to be more precise : one of the pages where I have the webcam BB code, the Gutenberg editor bails out.

    For me, after removing ALL extensions except WebCam, this combination does not work
    Gutenberg + Webcam + PDF Embedder ( https://wp-pdf.com/ ) => Editing a page that contains the Webcam BB = no-go.

    Gutenberg + Webcam = ok
    Gutenberg + PDF Embedder = ok

    When opening Guteberg, and the error shows up, it’s mentions :
    ….
    /wp-content/plugins/react-webcam/js/vendor/react.min.js?ver=5.0:5951:3
    ….
    /wp-includes/js/dist/vendor/react.min.js?ver=16.6.3:20:291
    ….
    As found out before : double instances of react.min.js are included. The same code (== functions, etc), different versions = no go (of course).

    What should be done is that React Webcam uses the build in the build-in (to WP)
    /wp-includes/js/dist/vendor/react.min.js?ver=16.6.3:20:291
    version and not includes it’s own (ancient) version.

    Thread Starter gertjank

    (@gertjank)

    @006fazer : Right. I normally wait before doing a major update. Have to have access to PC’s where I can make data backups etc.
    But it’s done now. Running 5.0 and my camera (this extension) still updates ^^

    Without even thinking, I installed – as proposed when reading …/wp-admin/about.php – the old editor as an extension – and deactivated/removed the Gutenberg (the extension part).
    Will check later on if Gutenberg (and the more recent Java codes that comes allong with) still conflicts with this – webcam extension.

    • This reply was modified 6 years, 3 months ago by gertjank.
    • This reply was modified 6 years, 3 months ago by gertjank.
    Thread Starter gertjank

    (@gertjank)

    Update : I can use “Gutenberg” without disturbing this plugin.
    All is ok now.
    Case closed ^^

    mauibrew : I gave the same situation.
    Folders are like
    …./wp-content/uploads/webcam/
    In this folder I have the local IP of the DVR device = 192.168.1.8
    In that one, for each day
    /2018-11-16
    /2018-11-17
    In these date named folder, the iage are uploaded with names like
    DVR_ch7_20181117001022_T.jpg

    My typical image file path is :
    /path/to/where/are/your/files/wp-content/uploads/webcam/192.168.1.8/2018-11-17/DVR_ch7_20181117001022_T.jpg

    As said, the /2018-11-17/ part changes every day.

    I changed the get_last_filename function like this :

    function get_last_filename($subdir) {
    
    	$upload_dir = wp_upload_dir();
    	$webcam_dir = $upload_dir['basedir'] . '/' . WEBCAM_DIR . '/' ;
    
    	if ($subdir && preg_match('/[a-z0-9]/i', $subdir)) {
    		$webcam_dir .= $subdir . '/';
    	}
    
    	$files = getDirContents($webcam_dir);
    // Return the (relative path to the) file name - without the first '/' 
    	return deleteFirstChar(str_replace(realpath($webcam_dir), '',end($files)));
    };

    My function getDirContents is like this

    function getDirContents($dir, &$results = array()){
        $files = scandir( $dir );
        foreach($files as $key => $value){
            $path = realpath($dir.DIRECTORY_SEPARATOR.$value);
            if(!is_dir($path)) {
    			if (filesize($path) > 0)
    				$results[] = $path;
            } else if($value != "." && $value != "..") {
                getDirContents($path, $results);
            }
        }
        return $results;
    }

    as you already might have noticed, these directories will be filled up.
    I advise you to use a cron-like tool to clean them up.
    A simple shell script exampe :

    #!/bin/sh
    
    find /path/to/where/are/your/files/wp-content/uploads/webcam/192.168.1.8 -depth -mindepth 1 -mmin +60 -uid 1001 -exec rm -rdf {} \;

    which runs every day and removes all files and folders older then 60 minutes.

    Thread Starter gertjank

    (@gertjank)

    More info :
    Gutenberg included a far more recent “React” version. Instantiating of the class changed, thus the “java” part fails.

Viewing 5 replies - 1 through 5 (of 5 total)