[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f6E3kHcNbXQdzTCKpPmhYbhiRU10IPMNSJyqHjiqsxtU":3},{"slug":4,"name":5,"version":6,"author":7,"author_profile":8,"description":9,"short_description":10,"active_installs":11,"downloaded":12,"rating":11,"num_ratings":11,"last_updated":13,"tested_up_to":14,"requires_at_least":15,"requires_php":16,"tags":17,"homepage":18,"download_link":19,"security_score":20,"vuln_count":11,"unpatched_count":11,"last_vuln_date":21,"fetched_at":22,"vulnerabilities":23,"developer":24,"crawl_stats":21,"alternatives":32,"analysis":33,"fingerprints":64},"ninjadb","NinjaDB","0.8","Shahjahan Jewel","https:\u002F\u002Fprofiles.wordpress.org\u002Ftechjewel\u002F","\u003Cp>A lightweight, expressive query builder for WordPress. NInjaDB use the same \u003Ccode>$wbdp\u003C\u002Fcode> instance and methods, It will help you to write $wpdb queries easily and expressively. At least PHP 5.3 is required.\u003C\u002Fp>\n\u003Cp>It has some advanced features like:\u003Cbr \u002F>\n – Query Like Laravel Basic Queries\u003Cbr \u002F>\n – Where, orWhere methods\u003Cbr \u002F>\n – Search data in all the columns or specific columns\u003Cbr \u002F>\n – Easily Implement Pagination\u003Cbr \u002F>\n – use insert, update or delete methods expressively.\u003C\u002Fp>\n\u003Cp>The syntax is quite similar to Laravel’s query builder.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Simple Query:\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>The query below returns the row where id = 3, null if no rows.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>$row = ninjaDB('my_table')->find(3);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>Full Queries:\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>$query = ninjaDB('my_table')->where('post_author', '=', 1);  \u002F\u002F for equal you can just use where('post_author, 1);\n\u002F\u002F Get result as array of objects\n$query->get();\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Full Usage API\u003C\u002Fh3>\n\u003Cp>### Initiate\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F\u002F Select a table\n$query = ninjaDB()->table('post');  \u002F\u002F post is the table name without prefix;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>OR You can pass your table name as an argument\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F\u002F Select a table\n$query = ninjaDB('my_table');  \u002F\u002F post is the table name without prefix;\u003Ch3>Query\u003C\u002Fh3>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Get Easily\u003C\u002Fh3>\n\u003Cp>The query below returns the (first) row where id = 3, null if no rows.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>$row = ninjaDB('my_table')->find(3);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Access your row like, \u003Ccode>echo $row->name\u003C\u002Fcode>. If your field name is not \u003Ccode>id\u003C\u002Fcode> then pass the field name as second parameter \u003Ccode>ninjaDB('my_table')->find(3, 'author_id');\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>The query below returns the all rows as array of objects where author_id = 3, null if no rows.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>$result = ninjaDB('my_table')->findAll('author_id', 3);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Select\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>$query = ninjaDB('my_table')->select('*');\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch4>Multiple Selects\u003C\u002Fh4>\n\u003Cpre>\u003Ccode>->select(array('myfield1', 'myfield2', 'amyfield3'));\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Using select method multiple times \u003Ccode>select('a')->select('b')\u003C\u002Fcode> will also select \u003Ccode>a\u003C\u002Fcode> and \u003Ccode>b\u003C\u002Fcode>. Can be useful if you want to do conditional selects (within a PHP \u003Ccode>if\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Ch4>Get All\u003C\u002Fh4>\n\u003Cp>Return an array of objects.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>$query = ninjaDB('my_table')->where('author_id', 1);\n$result = $query->get();\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>You can loop through it like:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>foreach ($result as $row) {\n    echo $row->name;\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch4>Get First Row\u003C\u002Fh4>\n\u003Cpre>\u003Ccode>$query = ninjaDB('my_table')->where('author_id', 1);\n$row = $query->first();\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Returns the first row, or null if there is no record. Using this method you can also make sure if a record exists. Access these like \u003Ccode>echo $row->name\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch4>Get Rows Count, MAX, MIN, AVerage, SUM\u003C\u002Fh4>\n\u003Cpre>\u003Ccode>$query = ninjaDB('my_table')->where('author_id', 1);\n$count = $query->count();\n$max = $query->max('views'); \u002F\u002F Where `views` is the column name and all these will return integer \u002F float\n$min = $query->min('views');\n$avg = $query->avg('views');\n$avg = $query->avg('views');\n$sum = $query->sum('views');\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Where\u003C\u002Fh3>\n\u003Cp>Basic syntax is \u003Ccode>(fieldname, operator, value)\u003C\u002Fcode>, if you give two parameters then \u003Ccode>=\u003C\u002Fcode> operator is assumed. So \u003Ccode>where('name', 'jewel')\u003C\u002Fcode> and \u003Ccode>where('name', '=', 'jewel')\u003C\u002Fcode> is the same.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>ninjaDB('my_table')\n    ->where('name', '=', 'jewel')\n    ->whereNot('age', '>', 25)\n    ->orWhere('description', 'LIKE', '%query%');\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>whereIn\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>ninjaDB('my_table')\n    ->whereIn( 'id', array(1,2,3) ) \n    ->get();\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Limit and Offset\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>->limit(30);\n->offset(10);\n\n\u002F\u002F or you can use aliases\n->take(30);\n->skip(10);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Order By\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>->orderBy('id', 'ASC');\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Insert\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>$data = array(\n    'name' => 'Jewel',\n    'description' => 'Hello, There'\n);\n$insertId = ninjaDB('my_table')->insert($data);\n\ninsert() method returns the insert id. optionally you can pass $format of your data as `->insert($data, $format);` where `$format` is  an array of formats to be mapped to each of the value in $data\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch4>Batch Insert\u003C\u002Fh4>\n\u003Cpre>\u003Ccode>$data = array(\n    array(\n          'name' => 'Jewel',\n        'description' => 'Hello, There'\n    ),\n    array(\n        'name'        => 'Adre',\n        'description' => 'Hello, I am Adre Astrian'\n    ),\n);\n$insertIds = ninjaDB('my_table')->batch_insert($data);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>In case of batch insert, it will return an array of insert ids.\u003C\u002Fp>\n\u003Ch3>Update\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>$data = array(\n    'name' => 'Shahjahan Jewel',\n    'description' => 'Hello, There'\n);\n\nninjaDB('my_table')->where('id', 5)->update($data);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Will update the name field to \u003Ccode>Shahjahan Jewel\u003C\u002Fcode> and description field to \u003Ccode>Hello, There\u003C\u002Fcode> where \u003Ccode>id = 5\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch3>Delete\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>ninjaDB('my_table')->where('id', '>', 5)->delete();\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Will delete all the rows where id is greater than 5.\u003C\u002Fp>\n\u003Cp>If you find any typo or extend any functionality then please edit and send a pull request.\u003C\u002Fp>\n\u003Ch3>TODO\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>[ ]  join()\u003C\u002Fli>\n\u003Cli>[x]  whereIN()\u003C\u002Fli>\n\u003Cli>[ ]  whereNotIN()\u003C\u002Fli>\n\u003Cli>[ ] whereBetween\u003C\u002Fli>\n\u003Cli>[ ] whereNotBetween\u003C\u002Fli>\n\u003Cli>[ ] Having\u003C\u002Fli>\n\u003Cli>[ ] GroupBy\u003C\u002Fli>\n\u003Cli>[x] selectDistinct\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Cem>If you would like to implement any of the TODO please feel free to do and do a pull request\u003C\u002Fem>\u003C\u002Fp>\n\u003Cp>And, finally, consider to contribute to this plugin \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FWpManageNinja\u002FNinjaDB\" rel=\"nofollow ugc\">here\u003C\u002Fa>.\u003C\u002Fp>\n","Query Builder Database Wrapper for WordPress",0,1243,"2017-09-26T17:21:00.000Z","4.8.28","4.0","",[],"https:\u002F\u002Fwpmanageninja.com\u002F","https:\u002F\u002Fdownloads.wordpress.org\u002Fplugin\u002Fninjadb.zip",85,null,"2026-03-15T15:16:48.613Z",[],{"slug":25,"display_name":7,"profile_url":8,"plugin_count":26,"total_installs":27,"avg_security_score":28,"avg_patch_time_days":29,"trust_score":30,"computed_at":31},"techjewel",17,1330140,92,113,73,"2026-04-03T23:29:36.976Z",[],{"attackSurface":34,"codeSignals":40,"taintFlows":54,"riskAssessment":55,"analyzedAt":63},{"hooks":35,"ajaxHandlers":36,"restRoutes":37,"shortcodes":38,"cronEvents":39,"entryPointCount":11,"unprotectedCount":11},[],[],[],[],[],{"dangerousFunctions":41,"sqlUsage":42,"outputEscaping":50,"fileOperations":11,"externalRequests":11,"nonceChecks":11,"capabilityChecks":11,"bundledLibraries":53},[],{"prepared":43,"raw":44,"locations":45},15,1,[46],{"file":47,"line":48,"context":49},"src\\ModelTrait.php",123,"$wpdb->get_col() with variable interpolation",{"escaped":51,"rawEcho":11,"locations":52},2,[],[],[],{"summary":56,"deductions":57},"The ninjadb plugin v0.8 exhibits a strong security posture based on the provided static analysis. The complete absence of any identified attack surface, dangerous functions, or file operations is highly commendable and suggests robust development practices. Furthermore, the plugin demonstrates excellent data handling with 100% of SQL queries using prepared statements and all outputs being properly escaped, significantly mitigating risks of common injection vulnerabilities.\n\nThe vulnerability history is also clean, with no recorded CVEs. This, combined with the static analysis findings, indicates that the plugin is either exceptionally well-developed and maintained or has not been extensively targeted or tested for vulnerabilities. The absence of taint analysis findings further reinforces the impression of secure code, as no unsanitized data flows were detected.\n\nWhile the plugin's current state appears very secure, the lack of any capability checks or nonce checks on the (currently non-existent) entry points is a theoretical weakness. If entry points were to be introduced in future versions without proper authentication and authorization mechanisms, this could pose a risk. However, based solely on the provided data for v0.8, the plugin presents a very low security risk.",[58,61],{"reason":59,"points":60},"Missing Nonce Checks",5,{"reason":62,"points":60},"Missing Capability Checks","2026-03-17T06:43:17.241Z",{"wat":65,"direct":74},{"assetPaths":66,"generatorPatterns":69,"scriptPaths":70,"versionParams":71},[67,68],"\u002Fwp-content\u002Fplugins\u002Fninjadb\u002Fassets\u002Fcss\u002Fninjadb.css","\u002Fwp-content\u002Fplugins\u002Fninjadb\u002Fassets\u002Fjs\u002Fninjadb.js",[],[68],[72,73],"ninjadb\u002Fassets\u002Fcss\u002Fninjadb.css?ver=","ninjadb\u002Fassets\u002Fjs\u002Fninjadb.js?ver=",{"cssClasses":75,"htmlComments":76,"htmlAttributes":77,"restEndpoints":78,"jsGlobals":79,"shortcodeOutput":80},[],[],[],[],[],[]]